Skip to content

Instantly share code, notes, and snippets.

@rgabbard
rgabbard / iOS Simulator Device.scpt
Created August 24, 2011 15:03
AppleScript to set the active device type when the iOS Simulator launches
set selectedDevices to choose from list {"iPhone", "iPhone (Retina)", "iPad"} with prompt "Choose device type:" default items {"iPhone"} without multiple selections allowed
if selectedDevices is not false then
set selectedDevice to item 1 of selectedDevices as string
set thePListFolderPath to path to preferences folder from user domain as string
set thePListPath to thePListFolderPath & "com.apple.iphonesimulator.plist"
tell application "System Events"
tell property list file thePListPath
tell contents
set value of property list item "SimulateDevice" to selectedDevice
@olivierlacan
olivierlacan / launch_sublime_from_terminal.markdown
Created September 5, 2011 15:50
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

@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@euforic
euforic / ti.socket.io.js
Created June 5, 2012 17:02
Socket.io-client Titanium
/*! Socket.IO.js build:0.9.6, development. Copyright(c) 2011 LearnBoost <[email protected]> MIT Licensed */
/**
* Originally Ported to titanium by Jordi Domenech <[email protected]>
* source: https://github.com/iamyellow/socket.io-client
*/
this.io = {};
module.exports = this.io;
/**
@myleftboot
myleftboot / social.js
Created March 5, 2013 20:17
An implementation of social.js for Appcelerator Titanium. Works with Twitter v1.1 effective from 5th March 2013
/**
* This is a JavaScript module for Titanium Mobile made by Dawson Toth. I adapted the majority of this code from other
* authors to make it easy to share content on social sites through a single interface.
*
* Example usage: http://appc.me/social.sample.js
*
*/
//
@kwhinnery
kwhinnery / howto.md
Created May 13, 2013 00:42
Execute "tishadow run" in your Titanium app directory whenever a JavaScript file changes.

Automatic TiShadow Installs

Execute "tishadow run" in your Titanium app directory whenever a JavaScript file changes. Edit your JS files in a text editor, save, then switch to the test device or simulator. Profit.

Install supervisor

[sudo] npm install -g supervisor

Execute tishadow run anytime a JavaScript file changes

@willurd
willurd / web-servers.md
Last active November 13, 2024 13:44
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@wbroek
wbroek / genymotionwithplay.txt
Last active November 8, 2024 01:24
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@TatsuoWatanabe
TatsuoWatanabe / alloy.jmk
Last active September 7, 2015 18:57
Titanium + Alloy + TypeScript1.0RC のコンパイル ref: http://qiita.com/TatsuoWatanabe/items/14e6b8062d64d895e465
task("pre:compile", function(event,logger) {
var wrench = require("wrench"),
fs = require("fs"),
path = require("path");
var code = [
fs.readFileSync("/usr/local/lib/node_modules/alloy/bin/tsc.js"), // <- path to tsc.js in your environment
"module.exports = TypeScript;"
].join("");
fs.writeFileSync(process.env.TMPDIR + "tsc.js", code);
find-up() {
local path=$(pwd)
while [[ "$path" != "" && ! -e "$path/$1" ]]; do
path=${path%/*}
done
if [ "$path" != "" ]
then
echo "$path"
fi
}