Skip to content

Instantly share code, notes, and snippets.

View ThomasBurleson's full-sized avatar

Thomas Burleson ThomasBurleson

View GitHub Profile
function unkMH(req, res) {
var allowHeaders;
if (req.method.toLowerCase() === 'options') {
allowHeaders = ['Accept', 'Accept-Version', 'Content-Type', 'Api-Version', 'Authorization'];
if (res.methods.indexOf('OPTIONS') === -1) {
res.methods.push('OPTIONS');
}
res.header('Access-Control-Allow-Credentials', true);
res.header('Access-Control-Allow-Headers', allowHeaders.join(', '));

Recording a Great Coding Screencast

The Screen

First and foremost a coding screencast is about the code, and we need to make sure it looks great. There are a few aspects to this that help ensure that is the case.

Resolution

720p is the target resolution. In pixel terms this is 1280x720. We've gotten the best results when we record at 2560x1440 in a HiDPI (pixel double) mode, giving an effective visible resolution of 1280x720, but extremely crisp. This resolution is achievable on 27" monitors and retina MBPs.

'use strict';
var _ = require('underscore');
module.exports = function () {
var proto,
injections = [];
// define constructor function
find . -name .DS_Store -print0 | xargs -0 git rm --ignore-unmatch
#!/bin/sh
#
# Pre-commit hooks
######################################################################
# Environment Setup
# 1) Change directory to build dir so we can run grunt tasks.
# 2) Make sure path is extended to include grunt task executable
# dir, as this commit shell is executed in the git
# client's own shell; ie Tower and WebStorm have own shell path.
//from most to least verbose, but it is all the same in the end.
(function() {
var module = angular.module("myApp.myModel", []);
var MyModel = function MyModel() {
this.asyncService = null;
this.someApi = function() {
@ThomasBurleson
ThomasBurleson / js_test.html
Created February 28, 2012 02:52 — forked from s4nchez/js_test.html
Basic JavaScript skills test
<html>
<head></head>
<body>
<input name="myButton" type="button" value="button 1">
<input name="myButton" type="button" value="button 2">
<input name="myButton" type="button" value="button 3">
<script type="text/javascript">
var buttons = document.getElementsByName("myButton");
@ThomasBurleson
ThomasBurleson / angular-bc.js
Created February 7, 2012 22:41 — forked from vojtajina/angular-bc.js
Angular: decorates/intercepts $controller service
/**
* @license AngularJS
* (c) 2010-2012 AngularJS http://angularjs.org
* License: MIT
*/
/**
* Backward compatibility module for AngularJS
* @author Vojta Jina <vojta.jina@gmail.com>
*
@ThomasBurleson
ThomasBurleson / angular-ctrl-export-proposal.js
Created February 7, 2012 15:56 — forked from vojtajina/angular-ctrl-export-proposal.js
Angular: Export Ctrl Methods Proposal
// GOOGLE3 usage - bigger projects
var MyController = function($scope, $location) {
// controller's private state
this.$location = $location;
this.some = 12;
this.$scope = $scope;
// methods accessible from template
// these methods (defined in constructor) should contain only few logic,
@ThomasBurleson
ThomasBurleson / shmemplates.js
Created November 17, 2011 01:54 — forked from cowboy/shmemplates.js
Promises: template caching w/ $.getScript()
// shmemplates. req: needs to work x-domain and be fully cacheable
Bocoup.utils.template = (function($) {
// Request a template from the server. Returns a Deferred object.
function fn(key) {
return $.Deferred(function(dfd) {
if (key in fn.cache) {
dfd.resolve(fn.cache[key]);
} else {
$.getScript(fn.url + key, function() {