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 'date' | |
class Human | |
attr_reader :name | |
attr_reader :dob | |
def initialize | |
@dob = Date.new | |
end | |
def christen(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
#!/bin/bash | |
for u in `cat uris`; do curl -s $u | grep length | tr '><' ' ' >> l.txt; done; awk '{s+=$2}END{print (s/60) " min"}' l.txt; |
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
unfo@ubuntu:~$ sudo apt-get install maven2 | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
The following extra packages will be installed: | |
ant ant-optional bsh bsh-gcj fop icedtea-6-jre-cacao icedtea-6-jre-jamvm icedtea-netx icedtea-netx-common java-wrappers junit junit4 libapache-pom-java libasm3-java libatk-wrapper-java libatk-wrapper-java-jni libavalon-framework-java | |
libbackport-util-concurrent-java libbatik-java libbsf-java libclassworlds-java libcommons-beanutils-java libcommons-cli-java libcommons-codec-java libcommons-collections3-java libcommons-configuration-java libcommons-digester-java | |
libcommons-httpclient-java libcommons-io-java libcommons-jexl-java libcommons-jxpath-java libcommons-lang-java libcommons-logging-java libcommons-net2-java libcommons-parent-java libcommons-vfs-java libdom4j-java libdoxia-java | |
libeasymock-java libfop-java libganymed-ssh2-java libgcj-bc libgoogle-collections-java libhamcrest-java libhttpclient-java libhttpcore-ja |
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
From 69717a0b229bb55e2320cdfb194267dc7eec1cd7 Mon Sep 17 00:00:00 2001 | |
From: Jan Wikholm <[email protected]> | |
Date: Sun, 18 Aug 2013 11:34:31 -0700 | |
Subject: [PATCH] Muutamia pienia typo/format-fikseja | |
--- | |
Luento-8.textile | 12 ++++++------ | |
Luento-9.textile | 8 ++++---- | |
2 files changed, 10 insertions(+), 10 deletions(-) |
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 (input) { | |
return _.reduce(input, function(memo,val) { | |
memo.nums.push(val); // enqueue the current iterated value | |
if (memo.nums.length >= 5) { | |
while (memo.nums.length > 5) // dequeue excessive items | |
memo.nums.shift(); | |
var product = _.reduce(memo.nums, function(product, number) { return product * number; }, 1); | |
memo.high = Math.max(product, memo.high); |
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 | |
# Safer way to edit cron so you don't mistakenly REMOVE the entire crontab | |
# with crontab -r when you meant to type crontab -e | |
# Also provides useful diff of your changes | |
ts=$(date +%s) | |
before=/tmp/`whoami`_crontab_before_$ts | |
after=/tmp/`whoami`_crontab_after_$ts | |
crontab -l > $before |
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 | |
df -Ph | column -t |
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 | |
# Example: find /path/ -type f -mtime +5 | xargs ls -l | sumls | |
awk '{ sum += $5 } END { print "total: " (sum / 1024 / 1024) " MB" } ' |
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
var alphabet = { | |
'0': 'e', | |
'00':'i', | |
'000':'s', | |
'0000':'h', | |
'00000':5, | |
'00001':4, | |
'0001':'v', | |
'00011':3, | |
'001':'u', |
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 | |
# crontab example: | |
# 30 20 * * * echo "" > /tmp/bar ; /data/network-debugging/ls-logger.sh | |
# 30 08 * * * echo 1 > /tmp/bar | |
INPUT_DIR=/data/foobar/input | |
DTM="$(date +%Y-%m-%d-%H-%M)" | |
LOGFILE="/data/network-debugging/ls.log-$DTM" |