- 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
defmodule Benchmark do | |
defmacro __using__(_) do | |
quote do | |
import Benchmark | |
def measure(name, function) do | |
{usecs, retval} = function |> :timer.tc | |
IO.puts("#{name} took #{usecs} µs") | |
retval | |
end | |
end |
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
#!/bin/sh | |
exec 1>&2 | |
MIX_ENV=test exec mix git.test |
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
task(default: [:link_hooks, :test]) | |
task :link_hooks do | |
sh 'ln', '-nsf', '../../hooks/pre-commit', '.git/hooks/pre-commit' | |
end | |
task :pre_commit do | |
require 'open3' | |
Dir.mktmpdir do |tmpdir| |
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
#!/usr/bin/env ruby | |
require 'pp' | |
DEBUG = false | |
class Board | |
class Impossible < StandardError; end | |
class Solved < StandardError; end |
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 | |
ENCODINGS = `iconv -l`.split(/\s+/) | |
PAIRS = ENCODINGS.permutation(2) | |
def iconv(input, from, to) | |
output = IO.popen(["iconv", "-f", from, "-t", to, :err => :close], "w+") do |fh| | |
fh.print(input) | |
fh.close_write | |
fh.read.force_encoding("ASCII-8BIT") |
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
--- extrabiomes.cfg-client 2013-04-09 19:17:45.000000000 -0400 | |
+++ extrabiomes.cfg-server 2013-03-04 18:48:06.000000000 -0500 | |
@@ -1,176 +1,139 @@ | |
# Configuration file | |
#################### | |
-# biome | |
+# block | |
#################### | |