Skip to content

Instantly share code, notes, and snippets.

View tmlbl's full-sized avatar

Tim tmlbl

View GitHub Profile
@tmlbl
tmlbl / card.js
Last active July 11, 2017 17:18
A Simple OOP-Type Object and Mocha Test
var Card = function (suit, rank) {
function constructor () { }
constructor.prototype.getSuit = function () {
return suit;
};
constructor.prototype.setSuit = function (s) {
suit = s;
};
constructor.prototype.getRank = function () {
return rank;
@tmlbl
tmlbl / Procfile
Last active August 29, 2015 13:56
A 'Hello World' server for Node.js, Express, Jade and Heroku
web: node index.js
@tmlbl
tmlbl / Gruntfile.js
Created February 13, 2014 17:12
A Gruntfile for linting and running Mocha tests
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
simplemocha: {
options: {
timeout: 3000,
ignoreLeaks: false,
reporter: 'tap'
},
@tmlbl
tmlbl / 0_reuse_code.js
Created March 5, 2014 00:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@tmlbl
tmlbl / javascript_resources.md
Created March 5, 2014 00:07 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@tmlbl
tmlbl / gist:9473624
Created March 10, 2014 20:28
Mongoose Schema Sublime Snippet
<snippet>
<content><![CDATA[
module.exports = function (Schema, mongoose) {
var ${1:Model}Schema = new Schema({
${2://properties...}
});
return mongoose.model('${1:Model}', ${1:Model}Schema);
};
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
@tmlbl
tmlbl / gist:9791989
Created March 26, 2014 20:04
Mongoose nested model
module.exports = function (Schema, mongoose) {
var CommentSchema = new Schema({
author : { type: String },
postdate : { type: Date, default: Date.now() },
body : { type: String }
});
var PostSchema = new Schema({
title : { type: String, required: true },
url : { type: String, required: true, unique: true },
postdate : { type: Date, default: Date.now() },
#---------------------------------------------
# TINT2 CONFIG FILE
#---------------------------------------------
# For more information about tint2, see:
# http://code.google.com/p/tint2/wiki/Welcome
#
# For more config file examples, see:
# http://crunchbanglinux.org/forums/topic/3232/my-tint2-config/
# Background definitions
<?xml version="1.0" encoding="UTF-8"?>
<openbox_config xmlns="http://openbox.org/3.4/rc" xmlns:xi="http://www.w3.org/2001/XInclude">
<resistance>
<strength>10</strength>
<screen_edge_strength>20</screen_edge_strength>
</resistance>
<focus>
<focusNew>yes</focusNew>
<!-- always try to focus new windows when they appear. other rules do
apply -->
# conky configuration
#
# The list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check http://conky.sf.net for an up-to-date-list.
#
# For ideas about how to modify conky, please see:
# http://crunchbanglinux.org/forums/topic/59/my-conky-config/
#
# For help with conky, please see: