Skip to content

Instantly share code, notes, and snippets.

View kosmikko's full-sized avatar

Mikko Lehtinen kosmikko

  • Applifier
  • Helsinki, Finland
View GitHub Profile
CTRL+a
Move cursor to beginning of the line. (I think of this as anchoring my cursor to the start.)
CTRL+e
Move cursor to the end of the line.
CTRL+k
Delete everything from under the cursor to the end of the line. (I think of this as killing the rest of my line.)
CTRL+f

tmux cheatsheet

Default prefix is crtl+b As configured in my dotfiles.

start new:

tmux

start new with session name:

@kosmikko
kosmikko / .gitconfig
Created October 24, 2012 07:04
My .gitconfig
[user]
name = Mikko Lehtinen
email = [email protected]
[alias]
st = status
stb = status -sb
co = checkout
promote = !$ZSH/bin/git-promote
wtf = !$ZSH/bin/git-wtf
@kosmikko
kosmikko / gist:3512434
Created August 29, 2012 13:24 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@kosmikko
kosmikko / gist:3083602
Created July 10, 2012 14:24
Makefile for compiling frontend assets
# build output dirs
BUILD_DIR = build
JS_BUILD_DIR = $(BUILD_DIR)/js
CSS_BUILD_DIR = $(BUILD_DIR)/css
IMG_BUILD_DIR = $(BUILD_DIR)/img
VENDOR_BUILD_DIR = $(BUILD_DIR)/vendor
TESTS_BUILD_DIR = test/build
# sources
TEMPLATES = $(shell find app -name '*.hbs')
@kosmikko
kosmikko / base_view.coffee
Created June 30, 2012 14:17
Extending Chaplin views
define [
'underscore'
'chaplin/views/view'
'app/views/base_extensions'
], (_, ChaplinView, BaseExtensions) ->
class BaseView extends ChaplinView
_(@prototype).extend BaseExtensions
@kosmikko
kosmikko / base_mixin.coffee
Created June 30, 2012 14:03
Provides common extensions to Chaplin views to be used as a mixin
define [
'chaplin'
'Handlebars'
], (Chaplin, Handlebars) ->
'use strict'
BaseExtensions =
trackAction: (category, action, label, value) ->
# track user action with Google Analytics
@kosmikko
kosmikko / dabblet.css
Created April 26, 2012 05:52
Vertical centering with Flexbox + margin fallback
/**
* Vertical centering with Flexbox + margin fallback
* Lea Verou & David Storey
*/
html, body { height: 100%; }
body {
width: 100%; /* needed for FF */
margin: 0;
@kosmikko
kosmikko / dabblet.css
Created April 26, 2012 05:52 — forked from LeaVerou/dabblet.css
Vertical centering with Flexbox + margin fallback
/**
* Vertical centering with Flexbox + margin fallback
* Lea Verou & David Storey
*/
html, body { height: 100%; }
body {
width: 100%; /* needed for FF */
margin: 0;
@kosmikko
kosmikko / mollom.py
Created September 29, 2011 13:14
Mollom API Python (GAE) wrapper
import urllib
from google.appengine.api import urlfetch
from gdata import oauth
class MollomRequest(object):
API_URL = 'http://rest.mollom.com/v1/'
# mollom public API key
CONSUMER_KEY = 'xxx'