Skip to content

Instantly share code, notes, and snippets.

View rpappalax's full-sized avatar

Richard Pappalardo rpappalax

  • Mozilla
  • Valencia, Spain
View GitHub Profile
@rpappalax
rpappalax / patch_gaia.sh
Created April 11, 2014 04:26
Shell script to patch gaia branch with FxA testcase automation & prefs
#!/bin/bash
if [ $1 ]
then
RELEASE=$1
else
RELEASE=`date +%Y%m%d`
fi
BRANCH="$HOME/git/B2G/gaia-rpappalax"
BRANCH_NEW="$HOME/git/B2G/gaia-$RELEASE"
var http = require('http');
var chunk = '';
var chunks = '';
var LEN_NO_MAIL = 10;
var isConfirmedEmail = function () {
var isConfirmed;
email = '[email protected]';
// getting socket hang up error
var http = require('http');
//var url = 'http://ip-api.com/json';
var url = 'http://restmail.net/mail/[email protected]';
var chunks;
function makeCall (url, callback) {
http.get(url,function (res) {
res.on('data', function (d) {
@rpappalax
rpappalax / DEMO-Flash_B2G.sh
Created June 19, 2014 17:04
Jenkins managed scripts - Multi-Node B2G
#!/bin/bash -e
DEV_SERIAL="$1"
ADB="adb -s $DEV_SERIAL"
echo "DEV_SERIAL = $DEV_SERIAL"
# adb root, then remount and stop b2g
function adb_root_remount() {
echo -e "\n\033[1mRoot and remount\033[0m"
@rpappalax
rpappalax / wallpaper.py
Created June 25, 2014 20:54
Python Pillow library for generating images
import PIL
from PIL import ImageFont
from PIL import Image
from PIL import ImageDraw
# font = ImageFont.truetype("Arial-Bold.ttf",14)
font = ImageFont.truetype("ArialUnicode.ttf",34)
img=Image.new("RGBA", (500,250),(255,255,255))
draw = ImageDraw.Draw(img)
draw.text((0, 0),"This is a test",(0,0,0) ,font=font)
@rpappalax
rpappalax / gist:6ffca98a3593f69f39ed
Last active August 29, 2015 14:04
PythonFiddle
http://pythonfiddle.com/algorithms-x-python-x-bubble-sort
#!/bin/bash
#
# Copies certain kinds of known files and directories from a given Jenkins master directory
# into a git repo, removing any old ones, adds 'em, commits 'em, pushes 'em.
#
set -ex
if [ $# -ne 2 ]; then
echo usage: $0 root_dir jenkins_master
@rpappalax
rpappalax / tag_project.sh
Created November 7, 2014 16:17
bash script to tag a release
#!/bin/bash -e
if (( $# != 1 )); then
echo "Please specify the tag"
exit 1;
fi
MY_PROJECT_DIR=$(basename $(pwd))
TAG=$1
echo "Tagging..."
git tag -a $1 -m "Release $1"
echo "Make version..."
@rpappalax
rpappalax / demo_simplepush.md
Created January 13, 2015 18:28
Demo - SimplePush
#!/bin/bash
# Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/
# Install stuff #
#################
# Install development tools and some misc. necessary packages
yum -y groupinstall "Development tools"
yum -y install zlib-devel # gen'l reqs