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
# dynamic removal of a dep requirement, | |
# based on a condition evaluated after previous requires have been processed | |
dep 'site' do | |
requires \ | |
'system', | |
'account', | |
'site dir', | |
'site options' | |
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 Ruport::Data::Table | |
def left_outer_join(right_table, field) | |
left_table = self | |
result = left_table.sub_table { |row| false } | |
new_col_names = right_table.column_names.reject { |i| i == field.to_s } | |
result.add_columns new_col_names |
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
ParticipationGraph.prototype = { | |
readData: function () { | |
var a = this.data.split("\n"); | |
this.allCommits = a[0] ? this.base64BytesToIntArray(a[0]) : ""; | |
this.ownerCommits = a[1] ? this.base64BytesToIntArray(a[1]) : "" | |
}, | |
// ... | |
base64ByteToInt: function (a) { | |
// This is known as modified Base64 for regexps: http://en.wikipedia.org/wiki/Base64#Regular_expressions | |
var d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!-"; |
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
chris-berkhouts-macbook-pro-2:~$ ping google.com | |
PING google.com (74.125.153.147): 56 data bytes | |
64 bytes from 74.125.153.147: icmp_seq=0 ttl=46 time=136.270 ms | |
64 bytes from 74.125.153.147: icmp_seq=1 ttl=46 time=135.076 ms | |
64 bytes from 74.125.153.147: icmp_seq=2 ttl=46 time=135.428 ms | |
64 bytes from 74.125.153.147: icmp_seq=3 ttl=46 time=134.717 ms | |
^C | |
--- google.com ping statistics --- | |
4 packets transmitted, 4 packets received, 0.0% packet loss | |
round-trip min/avg/max/stddev = 134.717/135.373/136.270/0.576 ms |
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
SELECT | |
`contents`.* | |
FROM | |
`contents` | |
INNER JOIN `contents_keywords` `contents_keywords_0` | |
ON `contents`.`id` = `contents_keywords_0`.`content_id` | |
INNER JOIN `contents_keywords` `contents_keywords_1` | |
ON `contents`.`id` = `contents_keywords_1`.`content_id` | |
INNER JOIN `contents_keywords` `contents_keywords_2` | |
ON `contents`.`id` = `contents_keywords_2`.`content_id` |
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 | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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 "childprocess" | |
class Pipes | |
class NullBit | |
def initialize | |
@read, @write = IO.pipe | |
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
#!/bin/bash | |
function exitIfRunning { | |
if ps ax | grep -v grep | grep Harvest\.app > /dev/null | |
then | |
echo "You must quit Harvest before continuing." | |
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
def pt(row) | |
return [1] if row == 0 | |
return [1, 1] if row == 1 | |
last = pt(row-1) | |
[1] + (0..row-2).to_a.map { |i| last[i] + last[i+1] } + [1] | |
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
#!/bin/bash | |
repo_host="apt.opengeo.org" | |
repo_dir="suite/v3/ubuntu" | |
repo_release="lucid" | |
echo -n "===> Please enter a bucket name: " | |
read -e bucket | |
echo "===> Confirming you have s3cmd configured..." |
OlderNewer