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
ruby -e 'p ",\x05\x14\x14\x1DD&\r\x16\x10\f\x00\x05\x1DD#\x11\x1D".chars.map{|x|(x.unpack("C")[0]^100).chr}.join' |
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
** Invoke spec (first_time) | |
** Invoke vendor_orgmode (first_time) | |
** Invoke /Users/rob/src/quarto/vendor/org/lisp (first_time, not_needed) | |
** Invoke vendor/org-8.0.7 (first_time, not_needed) | |
** Invoke vendor/org-8.0.7.tar.gz (first_time, not_needed) | |
** Invoke vendor (first_time, not_needed) | |
** Execute vendor_orgmode | |
** Execute spec | |
/Users/rob/.rvm/rubies/ruby-2.0.0-p247/bin/ruby -S rspec ./spec/quarto/build_spec.rb ./spec/quarto/pandoc_epub_spec.rb ./spec/tasks/codex_spec.rb ./spec/tasks/export_spec.rb ./spec/tasks/highlight_spec.rb ./spec/tasks/master_spec.rb ./spec/tasks/sections_spec.rb ./spec/tasks/skeleton_spec.rb -t ~org | |
Run options: exclude {:org=>true} |
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
echo "foo\nbar\nbaz\nfoo\nbar\nbaz" | ruby -pe 'BEGIN{i=0}; $_.chomp! << "\t" unless (i += 1) % 3 == 0' | |
# Input: | |
# | |
# foo | |
# bar | |
# baz | |
# foo | |
# bar | |
# baz |
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
<?php | |
function register() | |
{ | |
if (!empty($_POST)) { | |
$msg = ''; | |
if ($_POST['user_name']) { | |
if ($_POST['user_password_new']) { | |
if ($_POST['user_password_new'] === $_POST['user_password_repeat']) { | |
if (strlen($_POST['user_password_new']) > 5) { | |
if (strlen($_POST['user_name']) < 65 && strlen($_POST['user_name']) > 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
require "rubygems" | |
require "liquidplanner" | |
# Assumes a file called ~/.lprc exists that contains: | |
# { "email": "[email protected]", "pass": "pa55w0rd", "space": 1234 } | |
config = JSON.parse(IO.read(File.expand_path("~/.lprc"))) | |
lp = LiquidPlanner::Base.new(email: config["email"], password: config["pass"]) | |
workspace = lp.workspaces(config["space"]) |
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 | |
# Requirements: Ruby and the Chronic gem | |
# | |
# Install Chronic with: `gem install chronic` | |
# | |
# Examples: | |
# | |
# $ strtotime 'in 60 days' | |
# 6 Dec 2013 14:55:44 |
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
function nscp() { | |
nslookup $1 | sed -n 'x;$p' | cut -d' ' -f2 | tee >(pbcopy) | |
} |
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
db = SQLite3::Database.new ":memory:" | |
# A sample SQLite table; all that's necessary is the lat and log fields | |
db.execute <<-SQL | |
CREATE TABLE users ( | |
email VARCHAR(255), | |
lat FLOAT, | |
lon FLOAT | |
) | |
SQL |
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
# | |
# Working with branches | |
# | |
# Get the current branch name (not so useful in itself, but used in | |
# other aliases) | |
branch-name = "!git rev-parse --abbrev-ref HEAD" | |
# Push the current branch to the remote "origin", and set it to track | |
# the upstream branch | |
publish = "!git push -u origin $(git branch-name)" |
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
sudo bzcat /var/log/secure*.bz2 \ | |
| perl -ne '/authentication error for( illegal user)? (\S+) from/ && print "$2\n"' \ | |
| sort | uniq -c | sed 's/^ *//' | sort -n |