Skip to content

Instantly share code, notes, and snippets.

View oeeckhoutte's full-sized avatar

Olivier Eeckhoutte oeeckhoutte

View GitHub Profile
@oeeckhoutte
oeeckhoutte / gist:9804695
Last active August 29, 2015 13:57
[Angular] Difference between Service, Factory and Provider in AngularJS
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
};
});
//factory style, more involved but more sophisticated
@oeeckhoutte
oeeckhoutte / gist:7943977
Created December 13, 2013 13:07
[UNIX] init script Redis
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@oeeckhoutte
oeeckhoutte / TMUX
Last active December 31, 2015 05:49
Tmux Commands
Tmux commands
Time to play around with tmux commands:
Ctrl-b c Create new window
Ctrl-b d Detach current client
Ctrl-b l Move to previously selected window
Ctrl-b n Move to the next window
Ctrl-b p Move to the previous window
Ctrl-b & Kill the current window
@oeeckhoutte
oeeckhoutte / Fix Cordova Xcode 5
Last active December 25, 2015 20:58
[Cordova][Xcode][Fix] After update to Xcode 5 - ld: symbol(s) not found for architecture armv7 or armv7s linker error
Go to your Cordova Project
Root Folder -> CordovaLib -> Right Click CordovaLib.xcodeproj -> Show Package Contents -> Open project.pbxproj
Replace all occurrences of (I had 4)
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;//in 2 out of 4 occurrences
"ARCHS[sdk=iphoneos*]" = armv7;
"ARCHS[sdk=iphoneos6.*]" = (
@oeeckhoutte
oeeckhoutte / Tmux tips
Created September 6, 2013 07:27
[UNIX] Tmux
# 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-b, you need to add this to `~/.tmux.conf`:
# remap prefix to Control + a
@oeeckhoutte
oeeckhoutte / gist:6281924
Created August 20, 2013 14:06
[Node] Express socket.io Node.js v0.10.15 bug cross domain (Allow-Control-Allow-Origin) work around
socketServer.server.removeListener('request', socketServer.server.listeners('request')[0]); //Work around to disable CORS
# 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/
@oeeckhoutte
oeeckhoutte / gist:5956447
Created July 9, 2013 10:42
[UNIX][OSX] Manage ftp server
sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist
sudo -s launchctl unload -w /System/Library/LaunchDaemons/ftp.plist
@oeeckhoutte
oeeckhoutte / gist:5598815
Created May 17, 2013 12:49
[UNIX] Git clone specific tag
git clone <repo-address>
git tag -l
git checkout <tag-name>
git branch -D master
git checkout -b master
@oeeckhoutte
oeeckhoutte / gist:5363363
Created April 11, 2013 13:27
[Bash][Debian] Install Python 2.7
sudo apt-get install build-essential libsqlite3-dev zlib1g-dev libncurses5-dev libgdbm-dev libbz2-dev libreadline5-dev libssl-dev libdb-dev
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar -xzf Python-2.7.3.tgz
cd Python-2.7.3
./configure --prefix=/usr --enable-shared
make
sudo make install