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
| // here we're getting a casper reference using requirejs (since this all runs off nodejs) | |
| var casper = require('casper').create(); | |
| // now we need to select the airlines | |
| var airlines = ['EI', 'BA', 'VS']; | |
| casper.start('http://www.kayak.co.uk/#/flights/LON-NYC/2013-01-28/2013-02-04', function() | |
| { | |
| // select our first airline | |
| this.click('#fs_airlines_' + airlines.shift() + '_only'); |
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
| <!DOCTYPE html> | |
| <html class="no-js"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0, minimum-scale=1.0" /> | |
| <title></title> | |
| </head> | |
| <body> | |
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/bash | |
| for folder in images/*; do | |
| for file in $folder/*.jpg; do | |
| convert "$file" -resize 1200 -quality 60 -interlace line -strip ../path/to/dest/$(basename $folder | tr [:upper:] [:lower:])/$(basename ${file// /_} | tr [:upper:] [:lower:]) | |
| done | |
| done |
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
| <?php | |
| define('ENVIRONMENT', $_SERVER['HTTP_HOST'] === 'domain.dev' ? 'development' : 'production'); | |
| include 'version.php'; | |
| function get_assets($ext, $template) | |
| { | |
| $folders = array( | |
| 'assets/' . $ext . '/vendor', | |
| 'assets/' . $ext |
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
| <IfModule mod_setenvif.c> | |
| <IfModule mod_headers.c> | |
| BrowserMatch MSIE ie | |
| Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie | |
| </IfModule> | |
| </IfModule> | |
| <IfModule mod_headers.c> | |
| Header append Vary User-Agent | |
| </IfModule> |
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
| <?php | |
| function get_assets($ext, $template) | |
| { | |
| $folders = array( | |
| 'assets/' . $ext . '/vendor', | |
| 'assets/' . $ext | |
| ); | |
| foreach ($folders as $folder) | |
| { |
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
| ZSH=$HOME/.oh-my-zsh | |
| ZSH_THEME="muse" | |
| alias zshconfig="st $HOME/.zshrc" | |
| COMPLETION_WAITING_DOTS="true" | |
| plugins=(git git-extras osx sublime) | |
| export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:$PATH | |
| export PATH=$HOME/.macports/bin:$HOME/.macports/sbin:$PATH |
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
| String.prototype.linkify = function() | |
| { | |
| var str = this.toString(); | |
| str = str.replace(/(https?:\/\/[^\s]+)/gim, '<a href="$1">$1</a>', str); | |
| str = str.replace(/([#|@][^\s]+)/gim, '<a href="http://twitter.com/$1">$1</a>', str); | |
| return str; | |
| } |
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/env bash | |
| DIR='tmp' | |
| REMOTE='your_app' | |
| echo 'Making tmp dir' | |
| if [[ -d "$DIR" ]]; then | |
| rm -rf $DIR | |
| fi | |
| echo 'Exporting SVN to tmp' |
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
| var Storage = function(name, callback) | |
| { | |
| var cache = { }; | |
| var keysIndex = '_' + name + '_'; | |
| var write = true; | |
| // let's cache! | |
| function _get(key) | |
| { | |
| var data = _.clone( cache[ key ] ); |