Skip to content

Instantly share code, notes, and snippets.

View jimthedev's full-sized avatar

Jim Cummins jimthedev

View GitHub Profile
@jimthedev
jimthedev / emo.php
Created May 7, 2013 17:09
Command line wrapper for emogrifier written in PHP
<?php
/* DETECT CLI MODE */
if ( isset($_SERVER['argc']) && $_SERVER['argc']>=1 ) {
/* CHECK FOR EMOGRIFIER.PHP */
if(!file_exists(dirname(__FILE__).'/emogrifier.php')) {
quit(1,"emogrifier.php is missing.");
}
require_once(dirname(__FILE__).'/emogrifier.php');
@jimthedev
jimthedev / aliases
Created May 7, 2013 17:42
Bash script at ~/.emo/aliases that calls emo.php, the emogrifier wrapper
myemo(){
php ~/.emo/emo.php $1 $2 $3
}
alias emo=myemo
@jimthedev
jimthedev / emo.sublime-build
Created May 11, 2013 07:26
SublimeText2 Build File for Emogrifier Wrapper (emo.php)
{
"cmd": ["/usr/bin/php ~/.emo/emo.php $file_name style.css|open -a /Applications/Sublime\\ Text\\ 2.app -f"],
"shell": true
}
@jimthedev
jimthedev / php.except.ini
Created November 29, 2013 20:12
Zend 1 with Doctrine 2 php.ini file excerpt
include_path = ".:/usr/local/zf/library/Zend:/usr/local/doctrine/library:/usr/local/doctrine/library/doctrine/common/lib:/usr/local/doctrine/library/doctrine/dbal/lib:/usr/local/doctrine/library/doctrine/cache/lib:/usr/local/doctrine/library/doctrine/annotations/lib:/usr/local/doctrine/library/doctrine/orm/lib:/usr/local/doctrine/library/doctrine/lexer/lib"
@jimthedev
jimthedev / 0_reuse_code.js
Created December 15, 2013 22:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jimthedev
jimthedev / reduceOrientation.js
Created February 17, 2016 22:36
Reduce orientation events coming from react-native-orientation npm module
function _reduceOrientation(lastOrientation, orientation) {
if(orientation==='UNKNOWN' && lastOrientation==='UNKNOWN') {
return 'UNKNOWN';
}
switch(orientation) {
case 'LANDSCAPE':
case 'PORTRAIT':
return orientation;
@jimthedev
jimthedev / index.js
Last active July 6, 2016 03:57
requirebin sketch
var mobx = require('mobx');
var _ = require('lodash');
/*
MOBX in VANILLA ES5
Notes are based on Matt Ruby's Open Source North Talk:
Practical React with MobX
https://www.youtube.com/watch?v=XGwuM_u7UeQ
@jimthedev
jimthedev / .zshrc
Created July 24, 2016 17:22
Hacky first attempt at create-react-app but for https://github.com/HenrikJoreteg/hjs-webpack
# Creates a git and github repo in the projects folder
# and changes the current directory to it
proj() {
echo "Changing directory to ~/projects"
cd ~/projects
echo "Creating directory for project"
mkdir -p "$@"
echo "Changing directory to ~/projects/$@"
cd $@
echo "Creating git repo"
@jimthedev
jimthedev / .zshrc-partial
Created July 27, 2016 22:17
.zshrc fun with hub, git, npm, react, hjs-webpack
# Creates a git and github repo in the projects folder
# and changes the current directory to it
proj() {
echo "Changing directory to ~/projects"
cd ~/projects
echo "Creating directory for project"
mkdir -p "$@"
echo "Changing directory to ~/projects/$@"
cd $@
echo "Creating git repo"
@jimthedev
jimthedev / nvm-node-on-do-dokku-debian.md
Created August 9, 2016 14:33
Nvm-node-on-do-dokku-debian
sudo apt-get update && sudo apt-get install build-essential libssl-dev
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.4/install.sh | bash

You will likely get an error during install. Don't worry, it took but you need to change your bashrc file slightly. Add the following line to the bottom of /home/dokku/.bashrc:

source ~/.nvm/nvm.sh