Skip to content

Instantly share code, notes, and snippets.

@edrex
edrex / Automatically start Camlistore at login on OSX.md
Last active January 6, 2017 14:35
Automatically start Camlistore at login on OSX

I store my documents in a Camlistore, with a local instance running on my workstation and sync to an s3 bucket and a fixed server. Since I set this up 2 years ago, I've been manually starting camlistored and cammount inside a tmux session each time I log in to OSX.

Today I finally got around to setting up these processes to to start using the native OSX facility, launchd plists.

Steps:

  • camlistored and cammount should be in /usr/local/bin. I have them symlinked via

cd /usr/local/bin && ln -s ~/go/camlistore.org/bin/cam* . &&

@bensmithett
bensmithett / AppComponent.cjsx
Last active April 20, 2020 06:59
The world's tiniest guide to getting started with React, JSX, CoffeeScript & Webpack
React = require("react")
VideoPlayerComponent = require("components/VideoPlayerComponent")
AppComponent = React.createClass
# Need to add this manually if you want it to show up in React Chrome Dev Tools
# See https://github.com/jsdf/coffee-react-transform/issues/16
displayName: "AppComponent"
render: ->
<div>
@killercup
killercup / Gulpfile.coffee
Created September 14, 2014 12:28
A Gulp config for compiling CoffeeScript and Less using Webpack with a custom vendor.js and Hot Module Replacement for Less and React.js
# # Frontend Build Process
path = require('path')
gulp = require('gulp')
gutil = require('gulp-util')
plumber = require('gulp-plumber')
webpack = require("webpack")
# ## CONSTS
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active February 12, 2024 17:18
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@bobbydavid
bobbydavid / app.js
Created May 8, 2012 23:46
socket.io in Express 3
var express = require('express')
, http = require('http')
, connect = require('connect')
, io = require('socket.io');
var app = express();
/* NOTE: We'll need to refer to the sessionStore container later. To
* accomplish this, we'll create our own and pass it to Express
* rather than letting it create its own. */
var sessionStore = new connect.session.MemoryStore();
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@artero
artero / launch_sublime_from_terminal.markdown
Last active May 15, 2024 03:38 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@victorcampos
victorcampos / mongo_clean_shutdown.sh
Created June 29, 2011 02:19
Startup and shutdown scripts for MongoDB 1.8.2 (setting journaling, dbpath, daemonize, logging and rest interface)
#!/bin/bash
kill -2 `cat /data/mongod.lock`
@indexzero
indexzero / http-agent.js
Created June 6, 2011 02:11
Code samples from the "jsdom and jquery" article on the Nodejitsu blog
var httpAgent = require('http-agent'),
util = require('util');
var agent = httpAgent.create('www.google.com', ['finance', 'news', 'images']);
agent.addListener('next', function (err, agent) {
console.log('Body of the current page: ' + agent.body);
console.log('Response we saw for this page: ' + util.inspect(agent.response));
// Go to the next page in the sequence