Skip to content

Instantly share code, notes, and snippets.

View clintonhalpin's full-sized avatar
✌️

Clinton Halpin clintonhalpin

✌️
View GitHub Profile
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active July 14, 2024 19:27
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
JSCLASS_PATH = 'build/min';
require('./' + JSCLASS_PATH + '/loader');
JS.require('JS.Deferrable');
Promise = new JS.Class({
include: JS.Deferrable,
initialize: function(value) {
if (value !== undefined) this.succeed(value);
@scottjehl
scottjehl / anchorinclude.js
Created May 20, 2011 17:04
Anchor-include Pattern
/*
* anchor-include pattern for already-functional links that work as a client-side include
* Copyright 2011, Scott Jehl, scottjehl.com
* Dual licensed under the MIT
* Idea from Scott Gonzalez
* to use, place attributes on an already-functional anchor pointing to content
* that should either replace, or insert before or after that anchor
* after the page has loaded
* Replace: <a href="..." data-replace="articles/latest/fragment">Latest Articles</a>
* Before: <a href="..." data-before="articles/latest/fragment">Latest Articles</a>
@necolas
necolas / README.md
Last active March 28, 2024 20:34
Experimenting with component-based HTML/CSS naming and patterns

NOTE I now use the conventions detailed in the SUIT framework

Template Components

Used to provide structural templates.

Pattern

t-template-name
@jorilallo
jorilallo / grove.io.js
Created January 7, 2012 11:36
GitHub'fy Grove.io with dot.js
/*
** GitHub'fy Grove.io with dot.js
**
** source: http://github.github.com/github-flavored-markdown/scripts/showdown.js
** dotjs: http://defunkt.io/dotjs/
*/
var repo = 'Organization/repo';
setInterval(function(){

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@zilkey
zilkey / ember-precompile.js
Created March 10, 2012 22:30 — forked from garth/Jakefile.js
Precompile .handlebars templates with node js
var fs = require('fs');
var vm = require('vm');
var emberjs = fs.readFileSync('public/javascripts/vendor/ember-0.9.5.min.js', 'utf8');
var templatesDir = 'templates';
var destinationDir = 'public/javascripts/templates';
function compileHandlebarsTemplate(templatesDir, fileName) {
var file = templatesDir + '/' + fileName;
@Boztown
Boztown / pattern.js
Created June 21, 2012 22:19
Javascript: Extendible Pattern
//Self-Executing Anonymous Func: Part 2 (Public & Private)
(function( skillet, $, undefined ) {
//Private Property
var isHot = true;
//Public Property
skillet.ingredient = "Bacon Strips";
//Public Method
skillet.fry = function() {
@iwek
iwek / grab-images-wikipedia.php
Created July 12, 2012 20:38
Retrieve Images from Wikipedia
<?php
/**
* Grab Images from Wikipedia via thier API
*
* @author http://techslides.com
* @link http://techslides.com/grab-wikipedia-pictures-by-api-with-php
*/
//curl request returns json output via json_decode php function
@dergachev
dergachev / README.md
Created October 10, 2012 16:49
Vagrant tutorial

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM