Skip to content

Instantly share code, notes, and snippets.

View okor's full-sized avatar
🏎️

Jason Ormand okor

🏎️
  • Denver, CO
View GitHub Profile
@okor
okor / tmux.conf
Created May 14, 2012 18:54
tmux 1.6 config
unbind-key C-b
bind-key C-a send-prefix
# set-window-option mode-mouse on
set-option -g prefix C-q
# set -g status-bg white
# set -g status-fg black
#### COLOUR
@okor
okor / gist:2790431
Created May 25, 2012 20:36 — forked from mattmanning/gist:1430691
Fixing Apachebench on OS X Lion
brew install pcre
wget http://apache.mirrors.pair.com/httpd/httpd-2.4.2.tar.bz2
tar xzvf httpd-2.4.2.tar.gz
cd httpd-2.4.2
./configure
make
make install
sudo cp /usr/local/apache2/bin/ab /usr/sbin/ab
@okor
okor / is_blog.php
Created August 31, 2012 16:23 — forked from wesbos/is_blog.php
WordPress is_blog()
function is_blog () {
global $post;
$posttype = get_post_type($post );
return ( ((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_single()) || (is_tag())) && ( $posttype == 'post') ) ? true : false ;
}
Usage:
<?php if (is_blog()) { echo 'You are on a blog page'; } ?>
@okor
okor / gist:3788451
Created September 26, 2012 14:44
Files that are ruby
Gemfile
config.ru
Rakefile
@okor
okor / ab.rb
Created September 27, 2012 17:53
apache benchmark install for brew
require 'formula'
class Ab < Formula
homepage 'http://httpd.apache.org/docs/trunk/programs/ab.html'
url 'http://www.apache.org/dist/httpd/httpd-2.4.3.tar.bz2'
sha1 '0ef1281bb758add937efe61c345287be2f27f662'
def patches
end
@okor
okor / ffmpeg.rb
Created September 28, 2012 18:14
homebrew formula to install ffmpeg 1.0
require 'formula'
class Ffmpeg < Formula
homepage 'http://ffmpeg.org/'
url 'http://ffmpeg.org/releases/ffmpeg-1.0.tar.bz2'
sha1 'bf1f917c4fa26cf225616f2063e60c33cac546be'
head 'git://git.videolan.org/ffmpeg.git'
option "without-x264", "Disable H264 encoder"
@okor
okor / gist:4236979
Last active August 15, 2025 17:53
Git Cheat Sheet

Delete the last commit, if it hasn't been pushed.

git reset --soft HEAD~1

Delete the last commit, if it has been pushed.

git reset --hard HEAD~1
git push origin HEAD --force

Temporarily ignore local changes to a file

@okor
okor / MongoMapper_callbacks
Last active December 10, 2015 18:48
MongoMapper callbacks
# .create()
before_validation
validate
after_validation
before_save
before_create
after_create
after_save
# .save
@okor
okor / gist:5274842
Last active December 15, 2015 14:29
Varnish, cache nothing
backend default {
.host = "127.0.0.1";
.port = "8080";
}
# Drop any cookies sent to Wordpress.
# except when previewing
# also, cache nothing
sub vcl_recv {
if ( !(req.url ~ "(wp-login|wp-admin|preview=true)") ) {
@okor
okor / dark-munin-theme.css
Created September 22, 2013 19:56
Munin "theme" - it's dark
img { -webkit-filter: invert(1) !important; }
div.logo { -webkit-filter: invert(1) !important; background-color: white !important;}
* { background-color: black !important; }
*:not(a) { color: white !important; border: none !important; }
a { color: #4dfb45 !important; border: none !important; font-weight: normal !important; }