locally
go to the amazon web interface
note your AWS_USER_ID
in the upper right hand corner. create a new
AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
.
script/generate migration add_partner_id_to_sources partner_id:string |
git clone git://github.com/ry/node.git | |
cd node | |
./configure | |
make | |
sudo make install |
locally
go to the amazon web interface
note your AWS_USER_ID
in the upper right hand corner. create a new
AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
.
#! /usr/bin/env bash | |
if [ -z $1 ]; then | |
echo "ec2-ubuntu - easy ec2 ubuntu server creation" | |
echo "Usage: $0 instance-name [instance-type [ami [region]]]" | |
exit | |
fi | |
instancename=$1 | |
instancetype=${2:-'t1.micro'} | |
ami=${3:-'ami-1234de7b'} |
$(function() { | |
$(window).hashchange(function() { | |
var tab = window.location.hash.replace(/^#/, '') || initial; | |
switchTabs(tab); | |
}).hashchange(); // trigger on page load | |
}); |
[node@gerad ~]$ npm install mongodb | |
npm info it worked if it ends with ok | |
npm info using [email protected] | |
npm info using [email protected] | |
npm info fetch http://registry.npmjs.org/mongodb/-/mongodb-0.9.1.tgz | |
npm info calculating sha1 /tmp/npm-1299777263646/1299777263646-0.11996227549389005/tmp.tgz | |
npm info shasum 0b4c97289d9c88fc726a9993a8632d2ebe3284d6 | |
npm info calculating sha1 /home/node/.node_libraries/.npm/.cache/mongodb/0.9.1/package.tgz | |
npm info shasum 5ea811dd1b55ae50b5ebda38c853e7548c7d86db | |
npm info preinstall [email protected] |
[node@gerad ~]$ mkdir npm-hacks | |
[node@gerad ~]$ cd npm-hacks/ | |
[node@gerad ~/npm-hacks]$ git clone https://github.com/fortnightlabs/twitter-js | |
Initialized empty Git repository in /home/node/npm-hacks/twitter-js/.git/ | |
remote: Counting objects: 78, done. | |
remote: Compressing objects: 100% (69/69), done. | |
remote: Total 78 (delta 27), reused 0 (delta 0) | |
Unpacking objects: 100% (78/78), done. | |
[node@gerad ~/npm-hacks]$ cd twitter-js/ | |
[node@gerad ~/npm-hacks/twitter-js]$ npm link . |
<form onsubmit='alert("should not get here");'> | |
<input id="text" type="text" placeholder="type something and hit enter"> | |
</form> | |
<script> | |
var t = document.getElementById('text'); | |
t.addEventListener('keydown', function(e) { | |
if (e.which === 13) { // hitting return | |
alert('form submission should be prevented'); | |
e.stopPropagation(); |
require 'rubygems' | |
require 'bundler/setup' | |
require 'appscript' | |
# http://stackoverflow.com/questions/480866/get-the-title-of-the-current-active-window-document-in-mac-os-x | |
while true | |
frontmost = Appscript.app('System Events').application_processes.get.select{ |a| a.frontmost.get }.first | |
if frontmost | |
puts frontmost.name.get | |
if frontmost.windows.count > 0 |
// http://stackoverflow.com/questions/2107657/mac-cocoa-getting-a-list-of-windows-using-accessibility-api | |
// http://stackoverflow.com/questions/853833/how-can-my-app-detect-a-change-to-another-apps-window | |
// http://cocoatutorial.grapewave.com/tag/axuielementcopyattributevalue/ | |
- (NSDictionary *)axInfoForProcessIdentifier:(NSNumber *)processIdentifier | |
{ | |
NSMutableDictionary *ret = [NSMutableDictionary dictionaryWithCapacity:2]; | |
pid_t pid = (pid_t) [processIdentifier integerValue]; | |
AXUIElementRef app = AXUIElementCreateApplication(pid); | |
AXUIElementRef frontWindow = nil; | |
NSString *title = nil; |