Skip to content

Instantly share code, notes, and snippets.

@negamorgan
negamorgan / env-java-osx.md
Created September 22, 2014 20:28
Java 7 Dev Environment set up (OS X)
  1. Download JDK 7 for OS X x64 and follow the installation wizard.

  2. Add JAVA_HOME to env variables in .bash_profile, .bashrc or .zshrc

     export JAVA_HOME='/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home'
    
  3. Add java_home alias to .bash_profile, .bashrc or .zshrc

     alias java_home='/usr/libexec/java_home'
    
@negamorgan
negamorgan / jazz.sh
Created September 23, 2014 12:13
Jazz shell script example. From NetTuts tutorial.
#! /bin/sh
function help () {
echo "jazz - A simple script that makes using the Jasmine testing framework in a standalone project a little simpler."
echo ""
echo " jazz init - include jasmine in the project";
echo " jazz create FunctionName - creates ./src/FunctionName.js ./spec/FunctionNameSpec.js";
echo " jazz run - runs tests in browser";
}
@negamorgan
negamorgan / env-instantclient-osx.md
Last active August 29, 2015 14:06
Oracle InstantClient setup
  1. Download Oracle InstantClient basic, sqlplus, and SDK packages

     instantclient-basic-macos.x32-11.2.0.4.0.zip
     instantclient-sqlplus-macos.x32-11.2.0.4.0.zip
     instantclient-sdk-macos.x32-11.2.0.4.0.zip
    
  2. Extract files and rename directory, if desired

     /instantclient
    

|

@negamorgan
negamorgan / adv-command-line.md
Last active August 29, 2015 14:07
Advanced Command Line Techniques

Advanced Command Line Techniques

pushd to save an array of working directories

❤  sites  mkdir sandbox
❤  sites  cd sandbox
❤  sandbox  pushd ~/Downloads/php-master
~/Downloads/php-master ~/sites/sandbox ~/sites ~

dirs to return the array

on run {}
activate application "Microsoft Outlook"
tell application "Microsoft Outlook"
set selected folder to folder "Archive"
end tell
tell application "System Events"
keystroke "f" using {option down, command down}
end tell
end run

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@negamorgan
negamorgan / gulpfile.js
Last active August 29, 2015 14:20
gulpfile.js
'use strict';
var gulp = require('gulp'),
gp = require('gulp-load-plugins')(),
wiredep = require('wiredep').stream,
bs = require('browser-sync').create(),
reload = bs.reload;
// lint js with jshint, combine all files into one,
// write a minified and unminified version of file
@negamorgan
negamorgan / basic-sails-cms.sh
Created May 28, 2015 15:22
How to basic Sails.js CMS
npm install -g sails
sails new someAppName && cd someAppName
npm install --save sails-hook-adminpanel jade sails-mysql # or sails-mongo or sails-postgresql
touch config/adminpanel.js # TODO draw the rest of the owl here...
# in config/views.js, set 'engine' to 'jade'
mysql -uroot # only if you need a new mysql user
CREATE USER 'testuser'@'localhost'; # only if you need a new mysql user
GRANT ALL PRIVILEGES ON * . * TO 'testuser'@'localhost'; # only if you need a new mysql user
exit; # only if you need a new mysql user
@negamorgan
negamorgan / package.json
Created June 30, 2015 13:31
package.json
{
"name": "package",
"version": "0.0.0",
"dependencies": {
"foundation-sites": "^5.5.2",
"jquery": "^2.1.4"
},
"devDependencies": {
"browser-sync": "^2.7.1",
"browserify": "^10.2.4",
@negamorgan
negamorgan / es2015.js
Last active August 29, 2015 14:24
ES2015 syntax notes
let articles = [
{
body: 'lorem ipsum dolor sit amet',
title: 'i love articles'
},
{
body: 'lorem ipsum',
title: 'stuff and things'
},
{