Last updated: 2017-03-18
exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .
Note this can take a long time if you have a lot of jpgs
#!/usr/bin/env ruby -wKU | |
class Object | |
def destruct! | |
print "This message will self-destruct in..." | |
5.downto(0) {|i| print "#{i}..."; $stdout.flush; sleep(1)} | |
File.open(__FILE__, 'w') { } | |
end | |
end |
ps axc -o pid | grep -v PID | ruby -e 'puts STDIN.read.split("\n").shuffle.join("\n")' | head -1 | xargs kill |
import com.twitter.algebird.{Aggregator, Semigroup} | |
import com.twitter.scalding._ | |
import scala.util.Random | |
/** | |
* This job is a tutorial of sorts for scalding's Execution[T] abstraction. | |
* It is a simple implementation of Lloyd's algorithm for k-means on 2D data. | |
* | |
* http://en.wikipedia.org/wiki/K-means_clustering |
Last updated: 2017-03-18
exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .
Note this can take a long time if you have a lot of jpgs
# Copy the gem location to clipboard | |
bundle show yajl-ruby | pbcopy | |
# Example: /Users/gedrovits/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/yajl-ruby-0.8.2 | |
cd <cmd + v> | |
cd ext/yajl | |
# Now we need to replace 'inline void' to 'static void'. This will also create backup of old files. | |
sed -i '.bak' 's/inline void/static void/g' yajl_ext.h yajl_ext.c | |
# Now we must rebuild changed extension | |
make clean all | |
# After this you should not have any problems with yajl-ruby |
Found this tip in comment here: http://www.tipb.com/2011/01/04/tipb-bug-home-button-working-iphone/ | |
1.) Open any application | |
2.) Press and hold the power button until the slide to shutdown swipe bar appears. | |
3.) Release Power button | |
4.) Press and hold Home button Lightly | |
until screen returns to icon screen |
'use strict'; | |
// 1. Create the file: {projectRoot}/test.js | |
// 2. Install dependencies: npm i glob why-is-node-running | |
// 3. Run the tests: node --expose-internals test.js | |
const whyIsNodeRunning = require('why-is-node-running'); | |
const glob = require('glob'); | |
const Mocha = require('mocha'); |
/** | |
* Caches the return value of get accessors and methods. | |
* | |
* Notes: | |
* - Doesn't really make sense to put this on a method with parameters. | |
* - Creates an obscure non-enumerable property on the instance to store the memoized value. | |
* - Could use a WeakMap, but this way has support in old environments. | |
*/ | |
export function Memoize(target: any, propertyName: string, descriptor: TypedPropertyDescriptor<any>) { | |
if (descriptor.value != null) { |
After @mikeal and @lyle purchased Chromebooks for kids activities at NodeConf 2014, I was very impressed with the device and decided to explore this as a laptop and hacking device for my kids (7 & 8). I'd love to retain the simplicity of the web-focused ChromeOS experience while letting my kids hack on NodeBots and learn how to program.
It seems like the platforms that ChromeOS runs on are quite diverse. The Samsung 303C hit the right balance of being an aesthetically pleasing looking device, having respectable build quality and the amazing $250 price point. The 303C has an ARM processor. Not all Chromebooks do. I'm writing the below step-by-step very specifically for this system.
var _ = require('underscore'), | |
util = require('util'); | |
// intercept stdout, passes thru callback | |
// also pass console.error thru stdout so it goes to callback too | |
// (stdout.write and stderr.write are both refs to the same stream.write function) | |
// returns an unhook() function, call when done intercepting | |
module.exports = function interceptStdout(callback) { | |
var old_stdout_write = process.stdout.write, | |
old_console_error = console.error; |