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
$outdir = 'splitout' | |
def split file | |
base = File.basename file | |
if File.size(file) < 10000000 | |
puts `cp #{file} #{$outdir}/#{base}` | |
else | |
puts `zcat #{file} | split - -l 1000000 --filter='gzip > $FILE.gz' #{$outdir}/#{base[0..-3]}` | |
end | |
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
select ts, | |
seats, | |
sum(seats) over(order by rownum) as usage | |
from ( | |
select | |
row_number() over(order by '1') as rownum, | |
to_timestamp(columns[0], 'yyyy-MM-dd HH:mm:ss Z z') as ts, | |
case | |
when columns[1] = 'out' then cast(columns[3] as int) |
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
type Email struct { | |
From string | |
To []string | |
Subject string | |
Body string | |
} | |
func (email *Email) Send() error { | |
data := fmt.Sprintf("To: %s\r\nSubject: %s\r\n\r\n%s\r\n", | |
strings.Join(email.To, ","), |
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
@Grab( | |
group='org.codehaus.jackson', | |
module='jackson-mapper-asl', | |
version='1.9.11') | |
import org.codehaus.jackson.map.* | |
import org.codehaus.jackson.annotate.* | |
import groovy.transform.* | |
@Canonical | |
class MachineConfig { |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 | |
$server = $_POST['server']; | |
$db = $_POST['db']; | |
$raw_query = $_POST['query']; | |
$trimmed_query = trim(preg_replace('/\s+/', ' ', $raw_query)); | |
$cmd = 'sqlcmd -S ' . $server . ' -d ' . $db . ' -Q "' . $trimmed_query . '"'; | |
echo shell_exec($cmd); | |
?> |
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 ec8d67db882c28c74097020cc09b09f4cddc3097 Mon Sep 17 00:00:00 2001 | |
From: Krishna Karthik <nkkarthik@gmail.com> | |
Date: Sun, 15 Jul 2012 18:12:11 +0530 | |
Subject: [PATCH] Partial class name completion | |
--- | |
src/complete/core.clj | 24 ++++++++++++++++++++---- | |
test/complete/core_test.clj | 10 +++++++++- | |
2 files changed, 29 insertions(+), 5 deletions(-) |