Skip to content

Instantly share code, notes, and snippets.

View cmbirk's full-sized avatar

Chris Birk cmbirk

View GitHub Profile
@cmbirk
cmbirk / friday.js
Created February 22, 2014 19:10 — forked from krusynth/friday.js
function friday(e) {
if(e) {
// Not doin' nothin', it's Friday.
e.preventDefault();
}
/************$~I**************************Z*********************************
***********O,7.++O$+********************O,..ZI******************************
***********$..$.78.$******************$...7+. ~Z*******************+********
***********.Z.~.7D.O****************O,...,+. ....+Z*************7O+77I*+****
@cmbirk
cmbirk / es.sh
Created January 7, 2014 19:58 — forked from rajraj/es.sh
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
#!/bin/bash
filedir=$1;
echo "Starting converstion to mp4 script"
if [ -d "$filedir" ]; then
cd "$filedir"
for file in ./* ;
do
if [[ $file = *.mkv || $file = *.avi ]] ; then
@cmbirk
cmbirk / gist:6545739
Created September 13, 2013 00:54
PHP script to strip entities from XML
<?php
$unconvertedEntity = array(
'&percnt;',
'&numsp;',
'&lowbar;'
);
$convertedChar = array(
'%',
' ',
'_'
parse_str(file_get_contents("php://input"),$post_vars);
@cmbirk
cmbirk / laravel_debug_route
Created March 22, 2013 20:29
Debug Laravel Controller Call
public function __call($method, $parameters){
return dd(Request::route());
}
@cmbirk
cmbirk / center_box.js
Created January 14, 2013 16:24
Center Lightbox with jQuery
//Center Lightbox
function center_box(){
var body = $('body')[0];
var box_height = $('#lightbox').height();
var box_width = $('#lightbox').width();
var screen_height = $(body).height();
var screen_width = $(body).width();
var top = (screen_height / 2) - (box_height / 2);
var left = (screen_width / 2) - (box_width / 2);
@cmbirk
cmbirk / dbsync
Last active December 10, 2015 23:08
Bash command to help sync local db with remote server
#!/bin/bash -x
usage()
{
cat << EOF
usage: $0 options
OPTIONS:
-h Show this message
@cmbirk
cmbirk / Git ignore locally removed directory
Last active October 13, 2015 20:27
Git Ignore Locally removed directory (wp-admin)
find wp-admin -type f -print0 | git update-index --assume-unchanged -z --stdin
@cmbirk
cmbirk / Global WP Site Options
Last active October 8, 2015 17:18
Global WP Site Options
/** Global Site Options */
!defined('WP_SITEURL') && define('WP_SITEURL', "http://{$_SERVER['HTTP_HOST']}");
!defined('WP_HOME') && define('WP_HOME', WP_SITEURL);