Skip to content

Instantly share code, notes, and snippets.

yassersouri / gist:1668700
Created January 24, 2012 07:39
Sending SMS with andoroid
View gist:1668700
private void sendSMS(String to, String text) {
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(to, null, text, null, null);
yassersouri / gist:1668703
Created January 24, 2012 07:40
Sending SMS with andoroid - the fix
View gist:1668703
private void sendSMS(String to, String text) {
SmsManager sms = SmsManager.getDefault();
ArrayList<String> messages = sms.divideMessage(text);
sms.sendMultipartTextMessage(to, null, messages, null, null);
yassersouri /
Created February 11, 2012 20:50
Embedly's Challenge
def main():
i = 1
while True:
i += 1
print i
if s(factorial(i)) == 8001:
print 'YES'
def factorial(n):
yassersouri / gist:2039411
Created March 14, 2012 20:50
brew install -v opencv
View gist:2039411
› brew install -v opencv
/usr/bin/env python -c import numpy
==> Downloading
File already downloaded in /Users/Yasser/Library/Caches/Homebrew
/usr/bin/tar xf /Users/Yasser/Library/Caches/Homebrew/opencv-2.3.1a.tar.bz2
==> Patching
/usr/bin/patch -f -p1 -i 001-homebrew.diff
patching file modules/highgui/src/grfmt_exr.hpp
==> cmake . -DCMAKE_INSTALL_PREFIX='/usr/local/Cellar/opencv/2.3.1a' -DCMAKE_BUILD_TYPE=None -Wno-dev -DPYTHON_LIBRARY='/usr/local/Cellar/python/2.7.2/lib/libpython2.7.dylib' -DPYTHON_INCLUDE_DIR='/usr/local/Cellar/python/2.7.2/include/python2.7' -DPYTHON_PACKAGES_PATH='/usr/local/Cellar/opencv/2.3.1a/lib/python2.7/site-packages'
cmake . -DCMAKE_INSTALL_PREFIX='/usr/local/Cellar/opencv/2.3.1a' -DCMAKE_BUILD_TYPE=None -Wno-dev -DPYTHON_LIBRARY='/usr/local/Cellar/python/2.7.2/lib/libpython2.7.dylib' -DPYTHON_INCLUDE_DIR='/usr/local/Cellar/python/2.7.2/include/python2.7' -DPYTHON_PACKAGES
yassersouri / gist:3046001
Created July 4, 2012 08:00
subway's deploy error to nodejitsu
View gist:3046001
› jitsu deploy
path.existsSync is now called `fs.existsSync`.
info: Welcome to Nodejitsu yasser
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing your application dependencies in subway
warn: Local version appears to be old
warn: Your package.json version will be incremented for you automatically
warn: About to write /Users/Yasser/repo/subway/package.json
yassersouri / dtft.m
Created November 27, 2012 13:05
DTFT in matlab
View dtft.m
function [ X ] = dtft( x, n, w )
% [X] = dtft(x, n, w)
% X = DTFT values computed at w frequencies
% x = finite duration sequence over n
% n = sample position vector
% w = frequency location vector
temp = w' * n;
temp = -1i * temp;
yassersouri / gist:4959407
Last active December 13, 2015 18:58
View gist:4959407
# git aliases
alias gs='git status'
alias gl="git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"
alias gpom='git push origin master'
alias gpo='git push origin'
alias gp='git push'
alias glom='git pull origin master'
alias glo='git pull origin'
alias gm='git commit -m'
alias gma='git commit -am'
yassersouri /
Created February 15, 2013 11:19
`~/.matlab/R2012a/` for Mac OS X 10.8 with homebrew. via <>
# Shell script for configuring MEX-file creation script,
# mex. These options were tested with the specified compiler.
# usage: Do not call this file directly; it is sourced by the
# mex shell script. Modify only if you don't like the
# defaults after running mex. No spaces are allowed
# around the '=' in the variable assignment.
# Note: For the version of system compiler supported with this release,
yassersouri / Default (OSX).sublime-keymap
Created March 14, 2013 06:03 — forked from idan/Default (OSX).sublime-keymap
add the 1-2 layout to sublime text. Add these files with these file names to /Users/$ACCOUNTNAME$/Library/Application\ Support/Sublime\ Text\ 3/Packages/User
View Default (OSX).sublime-keymap
"keys": ["super+alt+shift+5"],
"command": "set_layout",
"caption" : "1-2 Grid",
"cols": [0.0, 0.5, 1.0],
"rows": [0.0, 0.5, 1.0],

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: