Skip to content

Instantly share code, notes, and snippets.

@daegren
daegren / REST.md
Last active December 17, 2015 04:28
Explaining REST to my Wife

Originally Posted here by Ryan Tomayko

Wife: Who is Roy Fielding?

Ryan: Some guy. He's smart.

Wife: Oh? What did he do?

Ryan: He helped write the first web servers and then did a ton of research explaining why the web works the way it does. His name is on the specification for the protocol that is used to get pages from servers to your browser.

@daegren
daegren / exercises.md
Last active December 17, 2015 15:19
sample sql database file to explain SQL

Exercises

In order to learn SQL, we'll go through some simple exercises to start

  1. Given the following statement:
CREATE TABLE `users` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`email` varchar(255) NOT NULL,
@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"
@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;
}
}
class Universe
while energy
decay
star = stars.pop
if star.mass > KASSHENDAR_LIMIT
BlackHole.new(star)
Notification.new('woah', Neo)
end
end
@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:

@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 / 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 / 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);

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: