Run command:
curl https://gist.githubusercontent.com/nicholasrq/f2da0281e102144af3c3/raw/install | sh
const { exec, execSync } = require('child_process'); | |
const FS = require('fs'); | |
const Path = require('path'); | |
const execCommand = (command) => new Promise((resolve, reject) => { | |
exec(command, (err, stdout) => { | |
if (err) return reject(err); | |
console.log(stdout); |
const childProcess = require('child_process') | |
const https = require('https') | |
const URL = require('url') | |
const out = (message = '') => { | |
console.log(message.trim().split('\n').map(r => r.trim()).join('\n')) | |
} | |
const exec = (cmd, callback) => { | |
if (cmd instanceof Function) { |
class Middleware{ | |
constructor(){ this.m = [] } | |
use(fn){ this.m.push(fn) } | |
run(d, f){ this._execute(d, f) } | |
_execute(d, f){ this.m.reduceRight((n, c) => v => c(v, n), f)(d) } | |
} | |
// usage | |
const m = new Middleware(); |
### | |
Example: | |
Pattern: http{s}://example.com | |
Will match: | |
http://example.com | |
https://example.com | |
Pattern: http{s}://example.com/* | |
Will match: |
#!/bin/sh | |
# you also can pass an argument which | |
# will be the name of a table in remote DB | |
# mysql_load users | |
mysql_load(){ | |
if ! type "pv" > /dev/null | |
then | |
echo "You should install Pipe View first" |
def self.reindex! | |
model_name = self.name.to_s | |
total = self.count | |
indexed = 0.to_f | |
progress = 0.to_f | |
row_length = 100.to_f | |
log_level = Sunspot::Rails::LogSubscriber.logger.level | |
time_start = Time.now | |
each_second = Time.now | |
per_second = 0 |
### | |
"Stalkable" objects can be watched for any and all changes | |
@author Bryan Elliott <[email protected]> | |
### | |
### | |
Detect whether an Object is using this Mixin | |
### | |
Ember.Mixin::detectInstance = (object) -> |