I hereby claim:
- I am deltamualpha on github.
- I am deltamualpha (https://keybase.io/deltamualpha) on keybase.
- I have a public key ASAHcIGA69GoZ2GE70pQbpKsWbRWeipiheYAq53ctGapLwo
To claim this, I am signing this object:
(defn magic [row] | |
(if (map? (first row)) (for [x row] (into [] (flatten (seq x)))) (into [] x))) | |
(defn collapser [incoming] | |
(reduce (fn [a b] (conj a (magic b))) [["header" "information"]] (remove nil? incoming))) | |
;for an input like | |
;([:a a :b b] nil nil [{:c c, :d d} {:e e, :f f}] nil [:a g :b h]) => | |
;[["test" "two"] [:a "a" :b "b"] ([:c "c" :d "d"] [:e "e" :f "f"]) [:a "g" :b "h"]] | |
;but what I want is |
$queries_array = {$query_1, $query_2, $query_n}; | |
$merged_array = array_reduce($queries_array, array_merge); | |
$uniques = array(); | |
$counter = array(); | |
foreach ( $merged_array as $current ) { | |
$counter[current->id] += $counter[current->id]; | |
$uniques[current->id] = $current; // pulls out unique only | |
} |
(defn get-attributes [html] | |
(map #(into {} %) | |
(map #(remove nil? %) | |
(map #(if (dom/attributes? %) [(:name (dom/attributes %)) (:value (dom/attributes %))]) | |
(map dom/node-seq | |
(xpath/lookup-nodeset "//form[@class=\"download\"]" html)))))) |
s3cmd ls --recursive s3://BUCKET_NAME |\ | |
ruby -rdate -ne 'date, time, size, uri = $_.split; puts uri if size == "0" && uri[-1,1] != "/" && !uri.include?(".")' |\ | |
xargs s3cmd del |
# install a phar file from a remote server directly | |
define php::phar ($url, $insecure = false, $target = $title) { | |
$split = split($url, '/') | |
$filename = $split[-1] | |
# for wget bug workarounds | |
if ($insecure == true) { | |
$wget_options = "--no-check-certificate" | |
} |
define php::conf { | |
if $::lsbdistcodename == 'precise' { | |
$php_build = '20090626' | |
file { "/etc/php5/conf.d/${title}.ini": | |
ensure => present, | |
owner => 'root', | |
group => 'root', | |
mode => '0644', | |
content => template("php/conf.d/${title}.ini"), |
I hereby claim:
To claim this, I am signing this object:
var palindrome_test = function(array) { | |
for (var i = 0; i <= array.length - 1; i++) { | |
if (array[i] !== array[array.length - i - 1]) { | |
return false; | |
} | |
} | |
return true; | |
} | |
var int2base = function(int, base) { |
var pyramid = function(width) { | |
if (width % 2 == 0) { | |
console.log("odd numbers only, please"); | |
return; | |
} | |
var gaps = ''; | |
for (var i = ((width-1)/2); i >= 0; i--) { | |
gaps += ' '; | |
} | |
var hashes = '#'; |
// Peculiar balance | |
// ================ | |
// Can we save them? Beta Rabbit is trying to break into a lab that contains the | |
// only known zombie cure – but there’s an obstacle. The door will only open if | |
// a challenge is solved correctly. The future of the zombified rabbit | |
// population is at stake, so Beta reads the challenge: There is a scale with an | |
// object on the left-hand side, whose mass is given in some number of units. | |
// Predictably, the task is to balance the two sides. But there is a catch: You | |
// only have this peculiar weight set, having masses 1, 3, 9, 27, … units. That | |
// is, one for each power of 3. Being a brilliant mathematician, Beta Rabbit |