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
class Numeric | |
SCALE_TO_WORD = Hash.new do |h, i| | |
" * 10^#{i * 3}" | |
end.merge({ 1 => " thousand", | |
2 => " million", | |
3 => " billion", | |
4 => " trillion" | |
}) | |
# in my unscientific test, no one really found names beyond trillion useful. |
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
# Ever get tired of people messing with your ruby classes? | |
# now you can put the hammer down and stop them. Just | |
# include this module and no one will be able to modify the | |
# class implementation or any instance implementations. | |
module Stop | |
module CantTouchThis | |
def self.included(mod) |
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/bash | |
# SSH into an EC2 instance by name | |
# Author: tokudu@github.com (SoThree.com). | |
set -e | |
if [ $# -lt 1 ] | |
then | |
echo "Usage: `basename $0` instance_name" | |
exit 1 | |
fi |
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
commit 744cfc17ad795077a427b19d02c10e4f0b5008b7 | |
Author: Don Petersen <don@donpetersen.net> | |
Date: Tue Mar 10 15:43:22 2015 -0600 | |
Include circle-compatible test output. | |
diff --git a/circle.yml b/circle.yml | |
index a2763cf..ece9b30 100644 | |
--- a/circle.yml | |
+++ b/circle.yml |
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 | |
# Ruby script to create recurring maintenance windows in PagerDuty | |
# | |
# Copyright (c) 2012, PagerDuty, Inc. <info@pagerduty.com> | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: | |
# * Redistributions of source code must retain the above copyright |
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
require 'watir-webdriver' | |
capabilities = Selenium::WebDriver::Remote::Capabilities.phantomjs("phantomjs.page.settings.userAgent" => "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1468.0 Safari/537.36") | |
driver = Selenium::WebDriver.for :phantomjs, :desired_capabilities => capabilities | |
browser = ::Watir::Browser.new driver | |
# Quick test to make sure it's set | |
browser.goto 'http://www.useragentstring.com/' | |
browser.textarea(:id => "uas_textfeld").value |
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 | |
# ########################################################## # | |
# wrapper for mosh to work with ssh's proxycommand directive # | |
# this only makes sense if the machine is directly reachable # | |
# from the internet using udp. # | |
# ########################################################## # | |
THISSCRIPT="`basename \"$0\"`" | |
REMOTE="$1" |
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
dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootflags=commit=120,data=writeback elevator=deadline rootwait quiet init=/sbin/bootchartd |
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 python3 | |
import re | |
import sys | |
import json | |
import urllib.request | |
import argparse | |
import subprocess | |
# get config | |
try: |
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
read -e IMAGE; | |
defaults write com.apple.desktop Background "{default = {ImageFilePath='$IMAGE'; };}" | |
killall Dock |
OlderNewer