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 up the prompt | |
autoload -Uz promptinit | |
promptinit | |
prompt adam1 | |
color_fix_precmd() { | |
PS1="`echo "$PS1" | tr Kk Ff`" | |
PS2="`echo "$PS2" | tr Kk Ff`" | |
PS3="`echo "$PS3" | tr Kk Ff`" | |
PS4="`echo "$PS4" | tr Kk Ff`" |
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 hidden | |
set background=dark | |
let mapleader="," | |
set incsearch | |
set shortmess=atI | |
set t_Co=256 " set to force 256 colors on uncool terminals | |
" Allow cyrillic letters in commands | |
set langmap=ёйцукенгшщзхъфывапролджэячсмитьбюЁЙЦУКЕHГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ;`qwertyuiop[]asdfghjkl\\;'zxcvbnm\\,.~QWERTYUIOP{}ASDFGHJKL:\\"ZXCVBNM<> |
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
" Maintainer: Lars H. Nielsen ([email protected]) | |
" Last Change: January 22 2007 | |
set background=dark | |
hi clear | |
if exists("syntax_on") | |
syntax reset | |
endif |
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/bin/ruby | |
class Array | |
# classic implementation using the left fold | |
# from StackOverflow | |
def min_index | |
champ = self.each_with_index.inject([1000, 0]) do |c, (v, i)| | |
cv = c[0]; ci = c[1]; | |
if v <= cv | |
[v, i] |
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 <unistd.h> | |
#include <sys/types.h> | |
#include <sys/ioctl.h> | |
int main (int argc, char **argv) | |
{ | |
pid_t pid; | |
int fd; | |
/* |
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/bin/perl | |
########################################################################## | |
# example: perl get-blip.pl http://spoonyexperiment.com/.../ | |
# | |
# if it doesn't work, make sure you copied the url from the addres bar, | |
# not a link to avoid getting a redirection page | |
########################################################################## | |
use strict; |
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
# myproject/config/initializers/handlebars_assets.rb | |
HandlebarsAssets::Config.path_prefix = 'backbone/templates' |
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
$('.test').each (i, e) -> | |
e = $(e) | |
content = e.find('.content') # Gee, I hope it's not global! | |
e.find('.refresh').on 'click', (e) -> | |
$.ajax { | |
method: 'GET', | |
url: 'http://example.com', | |
type: 'text' | |
success: (res) -> content.html(res) |
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
// It's debatable if it's actually a good idea, because most of the time the image will be | |
// loaded from the cache without revalidation anyway, but it still has some utility in cases | |
// when max-age is short, or the image is big | |
// | |
// Also, it is more useful if we assume that max-age is smaller than the average user session, | |
// and that the iOS device never has to evict the images in the UIImageView+AFNetworking cache, | |
// because then *every* request for the image that actually goes through the NSURLCache will | |
// trigger the double request codepath. That being said, it's still probably excessive, because | |
// the amortised delay before the image is shown is still not affected much | |
- (void)setImageWithURLRequest:(NSURLRequest *)originalURLRequest |
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
# | |
# parameters (including heuristic defaults) | |
# | |
if [ -z ${MY_SCHEME+x} ] | |
then | |
export MY_SCHEME=${PROJECT_NAME} | |
fi | |
if [ -z ${MY_WORKSPACE+x} ] |
OlderNewer