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 sh | |
if [ -n "$1" ]; then | |
sudo su -c "echo $1 >/sys/class/backlight/intel_backlight/brightness" | |
else | |
cat /sys/class/backlight/intel_backlight/brightness | |
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
stdbuf -oL alsactl monitor | \ | |
while read; do | |
amixer -D pulse sset Capture 32767,0 | |
done |
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 'headless' | |
require 'watir-webdriver' | |
require 'highline/import' | |
module BankAccounts | |
module TDBank | |
class Balance | |
LOGIN_URL = 'onlinebanking.tdbank.com' | |
def initialize |
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 'webrick/httpproxy' | |
port = ARGV[0] or 8000 | |
server = WEBrick::HTTPProxyServer.new(Port: port) | |
server.mount_proc('/'){|req,res|} | |
server.start |
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 'music_player' | |
require 'timer' | |
class AlarmClock | |
def initialize(music_player, timer) | |
@music_player = music_player | |
@timer = timer | |
end | |
def start | |
@timer.start { @music_player.start } |
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 | |
pwd = `pwd`.strip | |
targets = if ARGV.empty? | |
Dir["#{pwd}/*"] | |
else | |
ARGV.map do |arg| | |
Dir["#{arg.strip.gsub(/\/*$/,'')}/*"] | |
end.flatten.uniq | |
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
class CreateFriendships < ActiveRecord::Migration | |
def change | |
create_table :friendships do |t| | |
t.belongs_to :person, index: true, null: false, foreign_key: true | |
t.belongs_to :friend, index: true, null: false, foreign_key: true | |
t.timestamps null: false | |
end | |
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
#!/usr/bin/env bash | |
if [[ $# -ne 2 ]]; then | |
echo "Usage: $0 ./encrypted/dir ./visible/dir" | |
fi | |
/usr/bin/encfs $(readlink -f $1) $(readlink -f $2) |
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
// Place all the styles related to the pages controller here. | |
// They will automatically be included in application.css. | |
// You can use Sass (SCSS) here: http://sass-lang.com/ | |
.splash { | |
@extend .col-xs-12; | |
background: linear-gradient(to bottom, rgba(20, 20, 80, 0.5) 0%, rgba(20, 20, 80, 0.5) 100%), url(hero2.jpg); | |
background-size: cover; | |
min-height: 85vh; | |
color: #DED; |
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 'watir-webdriver' | |
require 'webrick/httpproxy' | |
# USAGE: ./proxied_browser.rb server (port) [json] | |
# ./proxied_browser.rb browser (port) | |
class ProxiedBrowser < Watir::Browser | |
def initialize(port) | |
proxy = ['localhost',port].join(?:) |
NewerOlder