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 | |
/* | |
* An improvised Gist from | |
* https://gist.github.com/zmsaunders/5619519 | |
* https://gist.github.com/garagesocial/6059962 | |
*/ | |
App::after(function($request, $response) | |
{ | |
if(App::Environment() != 'local') |
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
# Optimized for writes, sort on read | |
# LVC | |
redis.hset("bonds|1", "bid_price", 96.01) | |
redis.hset("bonds|1", "ask_price", 97.53) | |
redis.hset("bonds|2", "bid_price", 95.50) | |
redis.hset("bonds|2", "ask_price", 98.25) | |
redis.sadd("bond_ids", 1) | |
redis.sadd("bond_ids", 2) |
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
npm install glob --save-dev | |
npm install gulp-uncss --save-dev | |
var uncss = require('gulp-uncss'); | |
var glob = require('glob'); | |
gulp.task('uncss', function() { | |
gulp.src('public/css/dirty.css') | |
.pipe(uncss({ | |
html: glob.sync('app/views/**/*.*') |
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
create fdf | |
pdftk form.pdf generate_fdf output data.fdf | |
fill form | |
pdftk form.pdf fill_form data.fdf output form_with_data.pdf |
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
public function setUp() | |
{ | |
parent::setUp(); | |
$user = Sentry::getUserProvider()->findById(1); | |
Sentry::login($user); | |
} | |
public function tearDown() | |
{ | |
Sentry::logout(); |
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
sudo apt-get install python-setuptools | |
sudo easy_install virtualenv | |
virtualenv --no-site-packages django | |
source django/bin/activate | |
cd django | |
easy_install django | |
django-admin.py startproject myproject | |
cd myproject | |
python manage.py runserver [::]:8000 |
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
http://superuser.com/questions/814726/error-install-nginx-version-1-6-2-in-ubuntu-14-04 | |
add line | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
example: | |
location ~ \.php$ { | |
try_files $uri =404; |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "hashicorp/precise64" | |
config.vm.provision "docker" do |d| |
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 'mongoid' | |
Mongoid::Config.instance.from_hash({"database" => "oid"}) | |
class Tweeter | |
include Mongoid::Document | |
field :user | |
embeds_many :tweets | |
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
Use phantomjs. Start it: | |
$ phantomjs --webdriver=127.0.0.1:8910 | |
Use: | |
require_once('lib/__init__.php'); | |
$host = '127.0.0.1:8910'; | |
$capabilities = array( | |
WebDriverCapabilityType::BROWSER_NAME => 'phantomjs', |
OlderNewer