This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
#!/bin/bash | |
# https://httpd.apache.org/docs/2.2/misc/password_encryptions.html | |
HTPASSWD=$1 | |
USERNAME=$2 | |
PASSWORD=$3 | |
ENTRY=`cat $HTPASSWD | grep "^$USERNAME:"` | |
HASH=`echo $ENTRY | cut -f 2 -d :` | |
SALT=`echo $HASH | cut -f 3 -d $` |
#!/bin/bash | |
PORTS="80 443" | |
UNDO= | |
for p in $PORTS | |
do | |
iptables -I OUTPUT -p tcp --dport $p -j DROP -v | |
UNDO="$UNDO iptables -D OUTPUT -p tcp --dport $p -j DROP -v;" | |
done |
script -q /dev/null bundle exec rspec spec/lib/organization/manager_spec.rb -c -f d | bcat |
function export_skype_chat_history { | |
sqlite3 ~/Library/Application\ Support/Skype/saimonmoore/main.db "SELECT author,timestamp, body_xml FROM messages WHERE dialog_partner = '$1'" > ~/Desktop/skype_chat_history_$1.txt | |
} |
Jim Weirich:
This is how I explain it… Ruby has Procs and Lambdas. Procs are created with
Proc.new { }
, lambdas are created withlambda {}
and->() {}
.
In Ruby 1.8,
proc {}
creates lambda, and Ruby 1.9 it creates procs (don't ask).
Lambdas use method semantics when handling parameters, procs use assignment semantics when handling parameters.
This means lambdas, like methods, will raise an ArgumentError when called with fewer arguments than they were defined with. Procs will simply assign nil to variables for arguments that were not passed in.
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>Hello</title> | |
<link rel="stylesheet" href="styles.css"> | |
</head> | |
<body> | |
Hello World | |
</body> |
#! /usr/bin/env ruby | |
# usage: | |
# $ das_download.rb email password [download_directory] | |
require 'mechanize' | |
# gem 'mechanize-progressbar' | |
email = ARGV[0] or raise('Please provide the email address for your account') | |
password = ARGV[1] or raise('Please provide the password for your account') | |
path = ARGV[2] || './' |
mode = ENV["SPEC"] || "full" | |
require_relative "spec_helper_#{mode}" |
##How Homakov hacked GitHub and the line of code that could have prevented it
Please note: THIS ARTICLE IS NOT WRITTEN BY THE GITHUB TEAM or in any way associated with them. It's simply hosted as a Gist because the markdown formatting is excellent and far clearer than anything I could manage on my personal Tumblr at peternixey.com.
If you'd like to follow me on twitter my handle is @peternixey