Skip to content

Instantly share code, notes, and snippets.

Dope stuff
Visualizing Art of War
https://hbr.org/2015/02/visualizing-sun-tzus-the-art-of-war
@benbaker
benbaker / grade_c_programs.sh
Created October 30, 2014 15:48
Quickly walk, compile, and run every subdirectory
#!/bin/sh
# Quickly compile and run code for grading.
# ------------------------------------------------------------------------------
# Initiate and configure
# ------------------------------------------------------------------------------
usage()
{
echo "\033[33m\ncs_grade!\033[0m"
@benbaker
benbaker / gist:d873edfb0366ecced154
Created October 30, 2014 15:45
Time travel and grade a git repository
#!/bin/sh
# Run a command over a sequence of commits and get analytics on repo activity
# Example:
# ./gradethis origin/master 'make clean && make' > graded/build_history.txt
clear
help(){
echo "\n\nGradeThis!\n\n A tool for grading classes based on repository activity."
echo "\n\n Usage:\n"
@benbaker
benbaker / gist:d380abe7953220100ffb
Last active August 29, 2015 14:06
grade1050.sh
#!/bin/sh
# Quickly compile and run code for grading.
# ------------------------------------------------------------------------------
# Initiate and configure
# ------------------------------------------------------------------------------
usage()
{
echo "\033[33m\ncs_grade!\033[0m"
@benbaker
benbaker / $.serializeObject()
Created July 1, 2014 00:22
$.serializeObject()
$.fn.serializeObject = function()
{
var o = {};
var a = this.serializeArray();
$.each(a, function() {
if (o[this.name] !== undefined) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
}
o[this.name].push(this.value || '');
@benbaker
benbaker / gist:b7beb3c6e66188515738
Created June 15, 2014 01:44
Bash: Kill all processess container word
kill $(ps aux | grep 'node' | awk '{print $2}')
@benbaker
benbaker / gist:8205022
Created January 1, 2014 04:16
big blue bootstrap
/*!
* Bootstrap v2.0.4
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover,a:active{outline:0}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img{max-width:none}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle}button,input{*overflow:visible;line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;
@benbaker
benbaker / gist:8179338
Created December 30, 2013 08:25
jquery to add spans on regex
$('p.menu').html(function(i,el) {
return el.replace(/\|/g, '<span class="sp">|</span>');
});​
model
  • invariant dictionary
controller
  • syntax
  • morphology
  • phonology
view
@benbaker
benbaker / flatten bootstrap
Created November 20, 2013 03:11
flatten bootstrap
/* Flatten boostrap */
.well, .navbar-inner, .popover, .btn, .panel, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;