Skip to content

Instantly share code, notes, and snippets.

View twilson63's full-sized avatar

Tom Wilson twilson63

View GitHub Profile
@Marak
Marak / gist:3240974
Created August 2, 2012 21:50
WIP - Flatironisms

WIP

log all incoming http requests

app.http.before.push(function(req, res){
  app.log.info(req.url);
  res.emit('next');
})
@twilson63
twilson63 / install.md
Last active October 14, 2015 01:48
Install CouchDb and NodeJs on Ubuntu 12.04

Install CouchDb and NodeJS

Prereqs

sudo apt-get update -y
sudo apt-get install git-core build-essential -y

NodeJS 0.10.x

@twilson63
twilson63 / Gruntfile.js
Last active December 16, 2015 12:49
Gruntfile.js Template
var www = 'public';
var appFiles = [
www + '/app/app.js',
www + '/app/services/*.js',
www + '/app/filters/*.js',
www + '/app/directives/*.js',
www + '/app/controllers/*.js'
];
anonymous
anonymous / nodewebkit.md
Created June 27, 2013 02:08

Install instructions for nodewebkit on fedora 19 beta

download nodewebkit zip, extract to home directory

yum install curl -y
curl -O https://s3.amazonaws.com/node-webkit/v0.6.1/node-webkit-v0.6.1-linux-ia32.tar.gz
tar -zxvf node-webkit-v0.6.1-linux-ia32.tar.gz
ln -s /usr/lib/libudev.so.1 /usr/lib/libudev.so.0
export PATH=$PATH:/home/username/node-webkit-v0.6.1-linux-ia32

Angular-UI - ui-router

Lately, I have been digging into the angular-ui-router, (https://github.com/angular-ui/ui-router), I would say from ng-conf, it is the recommended way to do routing in Angular. What I find interesting about it, is how you can have multiple views and your routing graph can be defined in your loosely coupled modules. This provides a very conventional way to assembling your angular.modules for an angularjs application. Instead of having several features in your controller and templates directory, you can have several repositories that just focus on a particular feature.

For example, if you have two CRUD modules, (projects and contacts), with ui-router you can keep each routing state independent of the other as long as they are unique.

So in one module projects, I can have a config section and create the following routing state:

angular.js('projects', [])
@mikeal
mikeal / install.bash
Last active January 28, 2020 03:39
Find and install latest node from source on Ubuntu.
#!/bin/bash
echo "Finding latest version."
VERSION=`curl -s http://nodejs.org/dist/latest/SHASUMS.txt | awk '/node-v/ {print $2}' | head -1 | sed s/node-v// | sed s/-/\ / | awk '{print $1}'`
echo "Preparing to install node-v$VERSION"
url="http://nodejs.org/dist/v"$VERSION"/node-v"$VERSION".tar.gz"
echo "GET" $url
curl $url | tar -zxf -
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active June 30, 2024 04:14
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@Raynos
Raynos / click-event.js
Created August 31, 2014 05:43
Mercury router
module.exports = clickEvent;
function clickEvent(handler, opts) {
opts = opts || {};
return function clickHandler(ev) {
if (!opts.ctrl && ev.ctrlKey) {
return;
}

How to set your Acer C720 Chromebook to boot to Ubuntu by default.

  1. Place your closed laptop on a soft surface, upside down.
  2. Use a sharp knife to cut a hole in the warranty sticker (YES THIS WILL VOID THE WARRANTY).
  3. Remove the 13 screws with a small phillips head screwdriver (PH1 size works well). Be careful, the screws are very small and will strip easily if you use the wrong size screwdriver.
  4. Remove the bottom of the laptop by pulling up on it near the hinges. It takes a bit of pressure to remove, but if you lift it from the back (near the hinges) the same way you would open a laptop screen, the hooks won't break (even though they will make a loud snapping sound).
  5. Remove the BIOS write-protect screw. It is labeled as #7 in this image
  6. With the bottom off, turn over the laptop and open the screen.
  7. Plug the laptop in (it must b
@nolanlawson
nolanlawson / rant.md
Last active March 1, 2023 23:34
Misconceptions about PouchDB

Misconceptions about PouchDB

A quick rant.

  1. PouchDB is slow, because it doesn't use bare-metal IndexedDB

OK, first off I want to point out the CanIUse table for IndexedDB. Go ahead, look at it. I'll wait.