Skip to content

Instantly share code, notes, and snippets.

const greet = function(name) {
console.log("Hello, " + name + "!");
};
greet("Dave");
const sayHello = greet;
sayHello("Juan");
@daegren
daegren / local-dev-env-setup.md
Created December 12, 2018 17:35
Resources to setup a local development environment

Keybase proof

I hereby claim:

  • I am daegren on github.
  • I am daegren (https://keybase.io/daegren) on keybase.
  • I have a public key ASCEfH6uw8AOuQSGUgdpji1uVdYvKr6WL5go_W0d8iQ91wo

To claim this, I am signing this object:

@daegren
daegren / sum.js
Last active September 4, 2017 19:58
W1D1 Example
// Requirements:
// - Take in two numbers from the command line
// - `console.log` the sum of the two numbers
var input1 = process.argv[2];
var input2 = process.argv[3];
var number1 = parseInt(input1);
var number2 = parseInt(input2);
@daegren
daegren / index.js
Created August 18, 2017 21:18
Knex.js - Inlcuding multiple models in the response
const NODE_ENV = process.env.NODE_ENV || 'development';
const config = require('./knexfile')[NODE_ENV];
const knex = require('knex')(config);
const express = require('express');
const logger = require('knex-logger');
const app = express();
app.use(logger(knex));
@daegren
daegren / Rectangle.h
Created May 2, 2017 19:56
W1D2 breakout demo
//
// Rectangle.h
// BreakoutW1D2
//
// Created by David Mills on 2017-05-02.
// Copyright © 2017 David Mills. All rights reserved.
//
#import <Foundation/Foundation.h>
@daegren
daegren / GIF-Screencast-OSX.md
Created April 12, 2017 20:27 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

class Universe
while energy
decay
star = stars.pop
if star.mass > KASSHENDAR_LIMIT
BlackHole.new(star)
Notification.new('woah', Neo)
end
end
@daegren
daegren / Validator.js
Created April 20, 2015 22:30
Basic validator mixin for React
var ValidatorMixin = {
validate: function() {
var obj = this.state[this.validationObject];
var errors = {};
for (var key in this.validationRules) {
var rule = this.validationRules[key];
if (!rule.valid(obj[key])) {
errors[key] = rule.message;
}
}
@daegren
daegren / xcode-build-number-generator.sh
Last active May 23, 2022 11:21 — forked from alokc83/xcode-build-number-generator.sh
Script to automatically set the build number to the date
#!/bin/sh
# xcode-build-number-generator.sh
# @desc Automaticvally create build number every time using curent day, month and year
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"