Skip to content

Instantly share code, notes, and snippets.

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

Intro

Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Author: Chris Jacob @_chrisjacob

Tutorial (Gist): https://gist.github.com/833223

The Result

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
<provider
android:name=".providers.AssetProvider"
android:authorities="@string/provider_asset"
android:multiprocess="true"
android:exported="true"/>
<provider
android:name=".providers.AssetTagProvider"
android:authorities="@string/provider_assettags"
android:multiprocess="true"
#!/bin/bash
##########################
## Check if run as root ##
##########################
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
// These two need to be declared outside the try/catch
// so that they can be closed in the finally block.
HttpURLConnection urlConnection = null;
BufferedReader reader = null;
// Will contain the raw JSON response as a string.
String forecastJsonStr = null;
try {
// Construct the URL for the OpenWeatherMap query
@lovellfelix
lovellfelix / undo-git-rebase.sh
Created April 27, 2016 13:01 — forked from rymawby/undo-git-rebase.sh
Undoing a git rebase
# find head commit
git reflog
# now reset hard - where N is the head commit found in the reflog
git reset --hard HEAD@{N}
@lovellfelix
lovellfelix / networks.js
Created April 29, 2016 20:13 — forked from josephdburdick/networks.js
Seeds Mongo database but is immediately removed.
Networks = new Mongo.Collection('networks');
Networks.remove({});
if (Meteor.isServer) {
Networks.allow({
insert: function (userId, doc) {
return true; //userId === doc.userId;
},
update: function (userId, doc, fieldNames, modifier) {
return true; // userId === doc.userId;