Skip to content

Instantly share code, notes, and snippets.

View bittersweetryan's full-sized avatar

Ryan Anklam bittersweetryan

View GitHub Profile
@bittersweetryan
bittersweetryan / .bash_profile
Last active December 21, 2015 05:48
Add GIT branch in OSX Terminal. Add this code to the end of your ~/.bash profile.
# Git branch in prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
@bittersweetryan
bittersweetryan / gruntfile.js
Created August 21, 2013 12:48
Gruntfile, dynamically loading tasks
module.exports = function( grunt ){
var sourceFiles = [ 's-code.js', 's-code-page.js'];
grunt.initConfig({
pkg : grunt.file.readJSON( 'package.json' ),
uglify : {
all : {
files : {
@bittersweetryan
bittersweetryan / Gruntfile.js
Last active December 22, 2015 18:49
This Grunt config will only run a task on the file that has triggered the watch plugin.
/*
automatically sync files from the deploy directory back to the source directory
*/
module.exports = function( grunt ){
grunt.initConfig( {
copy : {
main: {
files : [
]
@bittersweetryan
bittersweetryan / micro_post.md
Last active December 25, 2015 19:29
box-sizing : border-box is not the silver bullet ALL the time.
/* 
Nope! The baseline of our text will be on top of the bottom border.
The 40px line height will extend above the top border causing the text
to be slightly towards to top of the "content" area.
*/
.vcenter-text-inline{
  box-sizing: border-box;
	height: 40px;
	border: 2px solid black;
var files = [];
function walkDirs( start ){
//since this is happening async how can I tell when it's done to process the files
fs.readdirSync( start, function( error, data ){
if( error ){
console.error( 'Oops!', error );
}
else{
<snippet>
<content><![CDATA[describe( '$1', function(){
$0
} );]]></content>
<!-- Optional: Tab trigger to activate the snippet -->
<tabTrigger>describe</tabTrigger>
<!-- Optional: Scope the tab trigger will be active in -->
<scope>source.js</scope>
<!-- Optional: Description to show in the menu -->
<description>describe bdd statement</description>
var Rx = require('rx');
var fs = require('fs');
var Observable = Rx.Observable;
// helper function for converting callback APIs to Observables
var toObservableFunction = Observable.fromNodeCallback;
// convert each callback function to a function that returns Observables
var checks = evt.check();
var saves = evt.save();
var results = O.concat( checks, saves );
results.subscribe(
function(){
...
},
function( err ){
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
string getUserInput();
void showPersonality( string );