Find out who added a particular file and when by
git log --diff-filter=A -- a/file`
With terse sort friendly format --pretty="format:%ad %h %an" --date=short
it is suitable for timelinig addition of several files
$ grep 'no-parallel' /home/tero/.nvm/versions/node/v4.2.3/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py | |
parser.add_option('--no-parallel', action='store_true', default=False, | |
$ /home/tero/.nvm/versions/node/v4.2.3/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp --no-parallel | |
Usage: gyp_main.py [options ...] [build_file ...] | |
gyp_main.py: error: no such option: --no-parallel |
node_modules/ | |
*~ |
Source: Anonymous comment to blog post Switching default PulseAudio device when USB microphone is plugged in
PulseAudio has built-in support for defaulting. Just add
# automatically switch to newly-connected devices
load-module module-switch-on-connect
to /etc/pulse/default.pa
right after these lines
# Copyright (c) 2014 Tero Tilus | |
# Published under MIT license http://opensource.org/licenses/MIT | |
# It is strongly recommended to have http://my.host/pub/root/ behind | |
# authentication and have a cronjob automatically cleaning up old files | |
# from /local/path/to/pub/root/ | |
$pub_url_base ||= 'http://my.host/pub/root/' | |
$pub_save_dir ||= '/local/path/to/pub/root/' |
// ... | |
it("reports error on invalid email", function(done) { | |
client | |
.setValue('#email', 'invalid@e.mail!'); | |
.click('#register'); | |
.getAttribute('#email.validated', 'class', function(err, result) { | |
expect(result).to.include('error'); | |
}) | |
.call(done); |
15:12:16.521 INFO - Executing: [find element: By.selector: #my-element-id] at URL: /session/efaa2f38-3fc8-4e9d-8813-b23c59a91406/element) | |
15:12:17.814 WARN - Exception thrown | |
org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"css selector","selector":"#my-element-id"} | |
Command duration or timeout: 14 milliseconds | |
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html |
#!/usr/bin/env ruby | |
# Snippet to decode images hidden using method described | |
# in http://randomperspective.com/comic/93/ | |
require 'rubygems' | |
require 'oily_png' | |
input_name = ARGV.first |
def fast_track(input) | |
input. | |
each_char. | |
map(&:to_i). | |
each_cons(5). | |
map { |consequtive_5| consequtive_5.reduce(:*) }. | |
max | |
end |