- Whenever you connect online, it redistributes your resources between offline and online.
- Generally, a small amount will remain offline and all the rest will go online.
- If you spend stuff for online stuff, it comes out of your online resources.
- If you spend stuff for regular (offline) stuff, it typically comes out of your offline resources.
- This can leave you deeply in the negative if you're ever offline.
- Being negative is very bad and can lead to staff leaving.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% ruby -rbcrypt -e '(1..100).each { |len| abort "max len is #{len}" if BCrypt::Password.create("a" * len) == "a" * (len+1) }' | |
max len is 72 | |
zsh: exit 1 ruby -rbcrypt -e | |
ruby -rbcrypt -e 9.12s user 0.06s system 99% cpu 9.192 total | |
% ruby -rbcrypt -rpp -e 'pp (1..100).map { |len| goodpass = "a" * len; badpass = "a" * (len+1); pass = BCrypt::Password.create(goodpass); [len, pass == goodpass, pass == badpass] }' | |
[[1, true, false], | |
[2, true, false], | |
[3, true, false], | |
[4, true, false], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name RPS mixed-content defuckifier | |
// @namespace rps-img-https | |
// @include https://www.rockpapershotgun.com/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
var images = document.getElementsByTagName('img'); | |
var length = images.length; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'tempfile' | |
KNOWN_HOSTS = ENV['HOME'] + '/.ssh/known_hosts' | |
read_fh, write_fh = IO.pipe | |
command = ['ssh', '-oStrictHostKeyChecking=yes'] + ARGV + ['echo', 'Successful connection.'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
command! home js set_multifox_profile("3"); | |
command! work js set_multifox_profile("2"); | |
" Get the multifox version hash by looking inside the multifox XPI file. | |
" (Look at the hash it uses in its own imports.) | |
:js << EOF | |
Components.utils.import("resource://multifox-88f97b0/commands.js"); | |
function set_multifox_profile(id) { | |
event = { | |
target: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'digest/md5' | |
def random_hex(length) | |
bytes_needed = (length + 1) / 2 | |
bytes = $urandom.read(bytes_needed) | |
hex = ("%02x" * bytes_needed) % bytes.bytes | |
return hex[0,length] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
Entry = Struct.new(:duration, :rows, :data) | |
def trim(array, limit, &block) | |
too_many = array.count - limit | |
if too_many > 0 | |
array.sort_by!(&block) | |
array.shift(too_many) | |
end |
- Unlike a lot of pre-commit scripts, it uses only the changes you've staged for commit, and doesn't touch your working tree (stash etc.).
- I use
skip 'slow' if ENV['FAST_TESTS'] == '1'
in tests that needlessly slow down everydayrake test
ing, but this runs them all before commit. - Written in 10 minutes. Barely tested. YMMV.
- See https://github.com/wisq/autocrew/blob/master/Rakefile for the latest version (e.g. if I find any bugs in this).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ruN a/bash/shell.c b/bash/shell.c | |
--- a/bash/shell.c 2011-01-02 21:04:51.000000000 +0000 | |
+++ b/bash/shell.c 2014-09-25 21:20:24.656725026 +0000 | |
@@ -1703,13 +1703,8 @@ | |
tilde_initialize (); | |
/* Initialize internal and environment variables. Don't import shell | |
- functions from the environment if we are running in privileged or | |
- restricted mode or if the shell is running setuid. */ | |
-#if defined (RESTRICTED_SHELL) |
Situation: Some commit (on master, but not necessarily head of master) has broken things, but it's a big commit and it's not clear what part broke things.
% git checkout master
% git checkout -b bisect-branch
% git revert <offending commit>
(test here to make sure reverting fixed your problem)
% git bisect start