Skip to content

Instantly share code, notes, and snippets.

View andyshora's full-sized avatar

Andy Shora andyshora

View GitHub Profile
@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

@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
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
@ryanjbonnell
ryanjbonnell / gist:3880048
Last active March 23, 2023 18:01
Install Memcache on Mac OS X 10.8 "Mountain Lion"
# memcached requires libevent
cd /usr/local/src
curl -L -O http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.17-stable.tar.gz
tar -xvzf libevent-2.0.17-stable.tar.gz
cd libevent-2.0.17-stable*
./configure
make
sudo make install
# Compile memcached utility
@ruiwen
ruiwen / fb-angular.js
Last active July 5, 2017 10:40
Wrapping and initialising the Facebook SDK with Angular JS
// Facebook SDK
angular.module('facebook', [])
.directive('fb', ['$FB', function($FB) {
return {
restrict: "E",
replace: true,
template: "<div id='fb-root'></div>",
compile: function(tElem, tAttrs) {
return {
post: function(scope, iElem, iAttrs, controller) {
@edouard-lopez
edouard-lopez / 0001-chore-yeoman-add-PHP-server-capabitilies.patch
Created August 31, 2013 09:40
Use PHP with your Yeoman dev server, config to run on `/` directory instead of `app/` (legacy project). More info see: http://coderwall.com/p/bal2_a
From 24c4a289dff902de91ac22e0d7d9d6c50331a22d Mon Sep 17 00:00:00 2001
From: Edouard Lopez <dev+git@edouard-lopez.com>
Date: Sat, 31 Aug 2013 11:25:14 +0200
Subject: [PATCH] chore(yeoman): add PHP server capabitilies
Following: https://coderwall.com/p/bal2_a
---
Gruntfile.js | 5 +++++
1 file changed, 5 insertions(+)
@LinusU
LinusU / README.md
Last active July 17, 2021 08:06 — forked from apla/icons_and_splash.js
Icons and Splash images for your Cordova project. (with iOS 7 support)

Usage

Install cordova into node_modules

npm install cordova

Add icons_and_splash.js

@foldi
foldi / README.md
Last active September 27, 2016 09:37
FloraJS | Sheep vs. Wolves

IMPORTANT: If the simulation above does not render correctly, click 'open in a new window'.

FloraJS | Sheep vs. Wolves

This simulation uses a custom Animal class that carries a custom sensor. One group, the Sheep, carries a Wolf sensor that triggers a COWARD behavior. The other group, the Wolves, carries a Sheep sensor that triggers an AGGRESSIVE behavior.

The result... the wolves chase the sheep. To make things fair, the sheep have a 'wrapWorldEdges' property set to true. When they cross the world boundary, they cross to the other side. Wolves however bounce off the world boundary.

Play with the various properties to affect the simulation.

@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active June 16, 2024 13:44
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@hdragomir
hdragomir / sm-annotated.html
Last active June 13, 2024 03:01
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active July 12, 2024 11:15
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest