I hereby claim:
- I am aasmith on github.
- I am aasmith (https://keybase.io/aasmith) on keybase.
- I have a public key whose fingerprint is 6CDC 81AC 6916 8916 C232 DCCE 6F0B 0A1B D764 A6B5
To claim this, I am signing this object:
# Get the possible max power state and current power states for the device. | |
# If they all match (i.e. the current state is the same as the max state), | |
# then the screen is assumed to be on. | |
power_management = `ioreg -n IODisplayWrangler |grep -i IOPowerManagement` | |
power_states = power_management.scan(/(?:"\w+PowerState"=(\d))+/) | |
abort "Not enough power states!" if power_states.size < 2 | |
screen_on = power_states.uniq.size == 1 |
#!/bin/bash | |
# flac2alac By Arlindo \"Nighto\" Pereira <[email protected]> | |
# (C) 2010. Licensed on GPLv3" | |
# modified by jeffrey paul <[email protected]> | |
# inspiration from http://ca.ubuntuforums.org/member.php?u=6176 (MetalMusicAddict) | |
# script at http://ca.ubuntuforums.org/showthread.php?t=889700&page=2 |
def lol(n) | |
Module.new { define_method(:hoho) { n } } | |
end | |
class Bar | |
extend lol 123 | |
end | |
Bar.hoho # => 123 |
# encode int i onto n bits | |
def encode(i, n) | |
a = [] | |
i = i.to_i | |
# Max number that can be stored on initial bits | |
max = 2**n - 1 | |
if i < max | |
a << i |
# Insert drive. | |
# See what drives are available. | |
diskutil list | |
# Unmount the target drive. | |
diskutil unmountDisk /dev/disk1 | |
# OPTIONAL step to convert ISO to usb compatible image (ubuntu ISOs require this) | |
hdiutil convert -format UDRW -o ~/path/to/target.img ~/path/to/ubuntu.iso |
#!/usr/bin/env ruby -w | |
# eachdir - Run a command in each child directory. | |
abort "need command" unless ARGV[0] | |
abort "quote the command" unless ARGV.size == 1 | |
def banner(path) | |
dirname, basename = File.split path | |
puts |
I hereby claim:
To claim this, I am signing this object:
# Before using this script, see output of pmset -g and note the value | |
# of hibernatemode. | |
pmset -g | |
# Save to disk, per pmset(1): | |
# | |
# hibernatemode = 25 (binary 0001 1001) is only settable via pmset. The | |
# system will store a copy of memory to persistent storage (the disk), and | |
# will remove power to memory. The system will restore from disk image. | |
sudo pmset -a hibernatemode 25 |
irb(main):002:0> Dir.glob("../x/*") { |x| `mv #{x} .`; puts "Added #{x}"; `time derp`; } | |
Added ../x/actionpack-3.2.20.gemspec | |
0.07 real 0.05 user 0.01 sys | |
Added ../x/activemodel-3.2.20.gemspec | |
0.06 real 0.05 user 0.01 sys | |
Added ../x/activerecord-3.2.20.gemspec | |
0.06 real 0.05 user 0.01 sys | |
Added ../x/activeresource-3.2.20.gemspec | |
0.07 real 0.05 user 0.01 sys | |
Added ../x/activesupport-3.2.20.gemspec |
irb(main):002:0> Dir.glob("../x/*").shuffle.each { |x| `mv #{x} .`; puts "Added #{x}"; `time foo`; } | |
Added ../x/sexp_processor-4.4.1.gemspec | |
0.10 real 0.08 user 0.01 sys | |
Added ../x/diff-lcs-1.2.4.gemspec | |
0.10 real 0.08 user 0.01 sys | |
Added ../x/wirble-0.1.3.gemspec | |
0.10 real 0.08 user 0.01 sys | |
Added ../x/byebug-2.7.0.gemspec | |
0.10 real 0.08 user 0.01 sys | |
Added ../x/ruby-progressbar-1.2.0.gemspec |