Skip to content

Instantly share code, notes, and snippets.

@marlun
marlun / mysql.txt
Created September 9, 2012 00:14 — forked from johnantoni/mysql.txt
mysql + vagrant + remote access
username: vagrant
password: vagrant
sudo apt-get update
sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev
sudo aptitude install mysql-server mysql-client
sudo nano /etc/mysql/my.cnf
@marlun
marlun / dabblet.css
Created September 8, 2012 13:30
Untitled
.parent {
background-color: #ddd;
text-align: justify;
width: 500px;
}
.child {
margin: 1px;
display: inline-block;
width: 100px;
# Remap prefix to Control + a (screen default)
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# Force a reload of config file
unbind r
bind r source-file ~/.tmux.conf
# Make tmux use 256 colors
@marlun
marlun / client.js
Created March 5, 2012 22:44
Client
var fs = require('fs')
var tls = require('tls')
var options = {
cert: fs.readFileSync('cert.pem'),
passphrase: 'passphrase'
}
var stream = tls.connect(700, 'hostname.com', options);
stream.setEncoding('utf8')
@marlun
marlun / index.js
Created March 4, 2012 01:11
Testing express apps
var express = require('express')
var app = module.exports = express.createServer()
app.listen(8000)
console.log("Started listening on port 8000")
@marlun
marlun / indent.coffee
Created February 24, 2012 14:37
Indentation problems
increaseIndexAbove model.index, (err) ->
if err
res.send 500
throw err
else
insertNewModel model, (err) ->
if err
res.send 500
throw err
else
function Test() {
// Not much
}
Test.prototype.say = function(msg) {
setTimeout(function() {
console.log(msg);
}, 2000);
};
stylus = require 'stylus'
path = require 'path'
express = require 'express'
app = express.createServer()
public_dir = path.join __dirname, 'public'
styles_dir = path.join public_dir, 'styles'
# Setup stylus compiler
compile = (str, path) ->
add_action('wpmu_new_blog', 'create_new_site');
function create_new_site($blog_id) {
switch_to_blog($blogid);
// Do all the work
switch_theme('marlun', 'marlun');
restore_current_blog();
}
# In general, there are many places in the file where you can leave off the parens in function calls, if you like.
unless typeof exports is "undefined" # `unless ... else` reads poorly in English. Better to stick to `if ... else`.
Spine = exports
else
Spine = @Spine = {}
Spine.version = "0.0.4"
$ = Spine.$ = @jQuery || @Zepto || -> arguments[0] # In Coffee, `or` is preferred over `||`.