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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 Foo | |
def a_string | |
"abcdef8" | |
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 ruby | |
require 'pty' | |
interface = 'en0' | |
cmd = %W[tshark -i #{interface} -R http -T fields -e wlan.sa -e http.user_agent] | |
cmd = "yes" | |
begin | |
PTY.spawn( cmd ) do |r, w, pid| |
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
Compile with `gcc -Wall -lssl -lcrypto shait.c` |
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
Compile with `gcc -Wall -lssl -lcrypto shait.c` |
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 | |
apt-get -y update | |
apt-get -y upgrade | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz | |
tar -xvzf ruby-1.9.3-p194.tar.gz | |
cd ruby-1.9.3-p194/ | |
./configure --prefix=/usr/local | |
make |
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
# Restart a rack app running under pow | |
# http://pow.cx/ | |
# | |
# Adds a kapow command that will restart an app | |
# | |
# $ kapow myapp | |
# | |
# Supports command completion. | |
# | |
# If you are not already using completion you might need to enable it with |
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 Person | |
attr_accessor :name, :weight | |
#want to set a default for @weight in here | |
#Tried @weight ||= 45 and | |
# @weight = 45 and | |
# self.weight = 45 | |
def initialize | |
@weight = 45 | |
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
def update | |
params[:server][:network_interfaces].collect!{|x| NetworkInterface.new(x)} | |
@server = Server.find(params[:id]) | |
respond_to do |format| | |
if @server.update_attributes(params[:server]) | |
flash[:notice] = 'Server was successfully updated.' | |
format.html { redirect_to(@server) } | |
format.xml { head :ok } | |
else |
NewerOlder