Skip to content

Instantly share code, notes, and snippets.

$ 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

Git tip: Who added that file?

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

@terotil
terotil / .gitignore
Last active January 8, 2023 19:37
JavaScript implementation of Bernoulli numbers algorithm as described by Ada Lovelace
node_modules/
*~
@terotil
terotil / pulseaudio-select-new-device-when-plugged.md
Created October 9, 2014 11:28
Pulseaudio select new device when plugged

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

Should be after module--restore but before module--detect

@terotil
terotil / publish.rb
Last active August 29, 2015 14:06
Sup publish hook to save attachment to download location
# 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/'

Janne-Matti Nurminen

Contact details

Really think you can find me online, LOL :D

Speaker bio

Janne-Matti is an independent systems arcitect and a consultant constantly looking for new problems to solve and complexities to

// ...
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