Skip to content

Instantly share code, notes, and snippets.

@amatsuda
amatsuda / gist:942211
Last active September 25, 2015 15:18
KeyRemap4MacBookで右Shiftとか右Cmdを単発で叩いたらアンスコにするやつ
<?xml version="1.0"?>
<root>
<list>
<item>
<name>Handy Underscore</name>
<list>
<item>
<name>Command_R to Command_R</name>
<appendix>(+ When you type Command_R only, send Underscore)</appendix>
<identifier>remap.commandR2commandR_underscore</identifier>
@lucasallan
lucasallan / install_postgis_osx.sh
Created September 6, 2011 21:03 — forked from klebervirgilio/install_postgis_osx.sh
Installing PostGIS on Mac OS X and Ubuntu
# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@simme
simme / Install_tmux
Created October 19, 2011 07:55
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@burke
burke / 0-readme.md
Created January 27, 2012 13:44 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@tomdale
tomdale / gist:3981133
Last active November 26, 2019 21:19
Ember.js Router API v2

WARNING

This gist is outdated! For the most up-to-date information, please see http://emberjs.com/guides/routing/!

It All Starts With Templates

An Ember application starts with its main template. Put your header, footer, and any other decorative content in application.handlebars.

<header>
@kurko
kurko / README.md
Created December 4, 2012 22:35
Javascript Acceptance tests framework

Javascript Acceptance test framework

This is a draft for an Acceptance testing framework in Javascript. See the example code.

Benefits

  • Server agnostic.
  • Tests in parallel.
  • The developer can stop a running test whenever he wants.
  • The framework can keep failed tests in iFrame instances, allowing the developer to debug them in the browser easily.
@kurko
kurko / gist:4243372
Created December 9, 2012 04:50 — forked from terryjray/gist:3296171
Enabling hstore for new postgresql 9.1 and rails 3 install on ubuntu 12.04
RAILS_ENV=production rake db:setup
# produces the error below.....hmmm.....it's a no-worky
psql:/yourprojectpath/yourproject/db/structure.sql:29: ERROR: could not open extension control file "/usr/share/postgresql/9.1/extension/hstore.control": No such file or directory
# hstore postgresql extension needs to be installed, so....
sudo apt-get install postgresql-contrib-9.1
# now your extension should be available to enable so log in with psql
psql -d yourproject_production -U yourdbuser -W
DS.Adapter.registerTransform('object', {
serialize: function(obj) { return obj; },
deserialize: function(obj) { return obj; }
});
MyApp.MyModel = DS.Model.extend({
location: DS.attr('object')
});
var model = MyApp.Model.createRecord({ location: { lat: 123, lng: 456 } });
@kurko
kurko / gist:5117251
Last active December 14, 2015 16:48
Object-Oriented Programming for defining what the system is and what it does

In a software, what matters for the end users is what the system does, not what the system is. A DVD has no value for the user unless you put it into the machine.

Architecture represents what the system is, while what it does is represented by the messages between objects, which is captured via use cases. Architecture is the form, the shape of something, in this case, the objects and the mechanisms to support them.

A good definition of use case is described as the solution to a particular problem. In Jerry Weinberg's words, "problem is the definition between the current state and the desired state". It's safe to assume that state is what the system is, which can be modified by the interaction between objects.

Objects relate to the end user, its business and its components. Classes don't. Classes are a way to represent objects, the state, but they do very poorly when trying to represent what the system does. Once you hit runtime, objects morph into total obscure forms due to the endless inte