This file contains hidden or 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
" <F2> Run 'perl -cw' over the code currently being edited | |
" <F3> Close current window | |
" <F4> Run code currently being edited as a perl script | |
" <F5> Load these keybinds even if vim doesn't think it is a perl script | |
" perl -cw buffer, open output in a new window | |
function! PerlCWBuffer() | |
let l:tmpfile1 = tempname() | |
let l:tmpfile2 = tempname() |
This file contains hidden or 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/sh | |
function charsort | |
{ | |
# accept a string and return the string sorted by character | |
sorted=$(for i in $(jot $(echo $1 | wc -c) 1); do | |
echo $1 | cut -c $i | |
done | sort | tr -d '\n') | |
echo $sorted | |
} |
This file contains hidden or 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
#include <stdio.h> | |
#include <time.h> | |
#ifndef isleap | |
#define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0) | |
#endif | |
int | |
main(int argc, char **argv) | |
{ |
This file contains hidden or 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
bundle agent init | |
{ | |
vars: | |
any:: | |
"sl[a]" string => "aa"; | |
"sl[b]" string => "bb"; | |
"sl[c]" string => "cc"; |
This file contains hidden or 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
# Cache images for one month | |
<FilesMatch ".(gif|jpg|jpeg|png|ico)$"> | |
Header set Cache-Control "max-age=2592000" | |
</FilesMatch> | |
# Cache text, CSS, and javascript files for one week | |
<FilesMatch ".(js|css|txt)$"> | |
Header set Cache-Control "max-age=604800" | |
</FilesMatch> |
This file contains hidden or 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
set -o noclobber | |
set -o vi | |
stty erase '^?' | |
PATH=$PATH:~/bin | |
CVS_RSH=ssh | |
if [ -d ~/.history ]; then | |
HISTFILE=~/.history/hist.$(tty | sed 's;.*/;;') |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <math.h> | |
#define C2F(c) c * 9 / 5 + 32 | |
#define F2C(f) (f - 32) * 5 / 9 | |
int | |
main(int argc, char **argv) |
This file contains hidden or 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/local/bin/perl | |
use strict; | |
my $z = 0; | |
for my $i (0..999) { | |
$z += $i if(($i % 3 == 0) || ($i % 5 == 0)); | |
} | |
printf("%d\n", $z); |
This file contains hidden or 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
defaults write NSGlobalDomain NSUseLeopardWindowValues YES | |
defaults write com.apple.Safari NSUseLeopardWindowValues NO | |
killall SystemUIServer |
This file contains hidden or 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/sh | |
CLUSTER=$(hostname | cut -d- -f 1) | |
GRAPHITE_PORT=2003 | |
REFRESH=5 | |
function _usage | |
{ | |
echo "$0 -g graphite-server [-p graphite-port] [-c cluster-name] [-r polling-interval]" | |
} |