Skip to content

Instantly share code, notes, and snippets.

View niftymonkey's full-sized avatar

Mark Lozano niftymonkey

  • Trello / Atlassian
  • Colorado Springs, CO
View GitHub Profile
### Keybase proof
I hereby claim:
* I am niftymonkey on github.
* I am niftymonkey (https://keybase.io/niftymonkey) on keybase.
* I have a public key ASBr3N5WiFNT32Rw4RiKRGUBpXpss-d7kfwHbid61snrigo
To claim this, I am signing this object:
I can't remember what I replied
@niftymonkey
niftymonkey / dashboard.json
Last active August 29, 2015 13:57
MobileStats - Logstash
{
"title": "Mobile Stats - Mark",
"services": {
"query": {
"list": {
"0": {
"id": 0,
"color": "#58140C",
"alias": "Resends",
"pin": false,
@niftymonkey
niftymonkey / lib.js
Created August 10, 2012 16:48
Require lib export issue
require.config({
paths: {
modernizr: "libs/modernizr-2.5.3",
jquery: "libs/jquery-1.7.2",
underscore: "libs/lodash-0.3.1",
backbone: "libs/backbone-0.9.2",
text: "plugins/text-2.0.0"
@niftymonkey
niftymonkey / gist:3019370
Created June 29, 2012 17:24
Exercise - Inheritance
// 1. Write a class to support the following code:
function Person(name) {
this.name = name;
};
var thomas = new Person('Thomas');
var amy = new Person('Amy');
thomas.name // --> "Thomas"
@niftymonkey
niftymonkey / gist:3015387
Created June 29, 2012 02:53
Exercise 1 - OO || !OO
/////////////////////////////////////////////
// Functional
/////////////////////////////////////////////
(function(functionName, container) {
function logMsg(color, make) {
console.log("I'm a " + color + " " + make);
};
@niftymonkey
niftymonkey / gist:3013233
Created June 28, 2012 19:04
Excercise 2 - Closures
var countdown = (function () {
var index;
function log(){
console.log(index);
}
function iterate(){
log();
if(index>1) setTimeout(iterate, 1000);
@niftymonkey
niftymonkey / gist:3012537
Created June 28, 2012 17:01
JSMC - Exercise 1
function isCreditCard( CC ) {
if (CC !== undefined && CC.length > 0 && CC.length <= 19) {
var sum = 0,
mul = 1,
l = CC.length;
for (i = 0; i < l; i++) {
digit = CC.substring(l-i-1,l-i);
tproduct = parseInt(digit ,10)*mul;
if (tproduct >= 10)
(defn insert [val lst]
(cond
(empty? lst) (list val) ; if it's an empty list, initialize it
(> (first lst) val) (conj lst val) ; if the first item is smaller than the first of lst, just conj
:else
(conj (insert val (rest lst)) (first lst)))) ; otherwise we need to keep calling insert recursively
(defn insertion-sort [lst]
(loop [list lst result '()] ; create local variables for our result set and the list passed in
(if (empty? list) result ; if the list passed in was empty, just return our empty result list