SSH into Root
$ ssh [email protected]
Change Root Password
| # this is a dirty implementation of logger that | |
| # compiles AR queries with trace into /last_request_log.html | |
| # the snippet is useful when optimizing performance of the endpoint | |
| class QueryLogSubscriber < ActiveSupport::LogSubscriber | |
| TRACE_LEVEL = :app | |
| LINES = 5 | |
| IGNORE_CACHED_QUERIES = false | |
| def initialize |
| # | |
| #= dump database to yaml for fixtures | |
| # | |
| # originated by elm200 <http://d.hatena.ne.jp/elm200/20070928/1190947947> | |
| # | |
| #== install | |
| # | |
| # move this file to RAILS_ROOT/lib/tasks/extract_fixtures.rake | |
| # | |
| namespace :db do |
SSH into Root
$ ssh [email protected]
Change Root Password
| module Concerns | |
| module Mocha | |
| module CallsThrough | |
| def calls_through | |
| method_name = @method_matcher.expected_method_name | |
| @mock.instance_variable_get(:@receiver) | |
| @original_method = @mock.instance_variable_get(:@mockery).stubba.stubba_methods.find do |mockery| | |
| mockery.method == method_name | |
| end.instance_variable_get(:@original_method) | |
| self |
| # less to scss based on http://stackoverflow.com/a/19167099/2363935 | |
| namespace :convert do | |
| task :less_to_scss do | |
| source_glob = "assets/less/*.less" | |
| dest_dir = "converted" | |
| rm_r dest_dir rescue nil | |
| mkdir_p(dest_dir) |
| # A little Meteor CheatSheet about Iron-Router. (updated on a weekly basis) | |
| # Check our Studio: https://gentlenode.com/ | |
| meteor add iron:router | |
| meteor update iron:router | |
| # Iron Router > Configuration |
| // === Arrays | |
| var [a, b] = [1, 2]; | |
| console.log(a, b); | |
| //=> 1 2 | |
| // Use from functions, only select from pattern | |
| var foo = () => [1, 2, 3]; |
| const int voltPin = 4; | |
| const int maxVoltAdjust = 230; // analog out is max 255, but for my voltmeter 230 == 100% | |
| void setup() { | |
| pinMode(voltPin, OUTPUT); | |
| Serial.begin(19200); | |
| } | |
| String inData; | |
To open SQLite Things.app database run this command in Terminal.app:
$ sqlite3 ~/Library/Containers/com.culturedcode.things/Data/Library/Application\ Support/Cultured\ Code/Things/ThingsLibrary.db
In SQLite command-line type this query to get your tasks stats:
sqlite> .mode column
sqlite> .header on
sqlite> select zscheduler, zstatus, ztrashed, count(*) from ZTHING where z_ent = 13 group by zstatus,ztrashed order by Z_pk desc;
ZSCHEDULER ZSTATUS ZTRASHED count(*)
| Make a subdirectory named packages/mynpms in your project. | |
| Add a package.js that looks something like this: | |
| Package.describe({ | |
| summary: "Custom app NPM dependencies" | |
| }); | |
| Npm.depends({ | |
| nconf: '0.6.7', | |
| feedparser: '0.16.1' |