Skip to content

Instantly share code, notes, and snippets.

View astagi's full-sized avatar
💫

Andrea Stagi astagi

💫
View GitHub Profile
@astagi
astagi / jenkinsgae.sh
Last active August 29, 2015 14:00
Jenkins build script for GAE + Virtualenv
export GAEPATH=/your/path/for/google_appengine
export PATH=$PATH:$GAEPATH
export PATH=$WORKSPACE/venv/bin:/usr/local/bin:$PATH
export PYENV_HOME=$WORKSPACE/.pyenv/
export PYTHONPATH=$PYTHONPATH:$GAEPATH
if [ -d $PYENV_HOME ]; then
rm -rf $PYENV_HOME
fi
@astagi
astagi / fixnslash
Created October 12, 2014 17:52
Hack'n'Slash fix for Mac OSX
chmod +x ~/Library/Application\ Support/Steam/SteamApps/common/HacknSlash/Hack.app/Contents/MacOS/Hack
@astagi
astagi / progress.py
Created January 27, 2015 11:58
Show progress in console with Python Add new snippet
import sys
def show_progress(actual, total):
percentage = actual / float(total)
done = int(50 * percentage)
sys.stdout.write("\r[%s%s] %d %%" % ('=' * done, ' ' * (50-done), percentage * 100))
sys.stdout.flush()
@astagi
astagi / testisgd.py
Created January 7, 2012 01:29
IS.GD Shorty-Python test for Turpial
import shorty
url = 'http://google.com'
short_service = shorty.Isgd()
st = short_service.shrink(url)
print st
@astagi
astagi / baby_rocker.sh
Created June 27, 2012 16:25
Baby Rocker by Arul John
#!/bin/sh
#Funny script by Arul John
#Visit http://aruljohn.com/notes/babyrocker.html
while [1 = 1] do
#eject cdrom
eject
@astagi
astagi / README
Created August 5, 2012 14:04
Android scripts for developing Android apps under Linux without using Eclipse
1. Install Apache Ant (http://ant.apache.org/)
2. Download the Android SDK from http://developer.android.com/sdk/index.html if you don't have it yet
3. Extract the package somewhere (I placed it in my home directory /home/andrea/android-sdk-linux_x86)
4. Set ANDROID_SDK environment variable with the path where you placed the SDK folder
5. Run buildall.sh to build the .apk
6. Run run.sh to launch Turpial on your device
7. In case you need to restart adb, run restartadb.sh
@astagi
astagi / pulcinopyo.py
Created August 17, 2012 18:36
PulcinoPyo: Python script for generating "Pulcino Pio" style (??) songs!
#!/usr/bin/env python
# -*- coding: latin-1 -*-
# PulcinoPyo: generate a "Pulcino Pio" style (??) song!
# Author: Andrea Stagi on vacation <stagi.andrea@gmail.com>
# License: c'mon default header, don't be silly :D
#Our type Animal
class Animal:
@astagi
astagi / RPN.py
Created August 30, 2012 10:26
RPN calculation using Python
import re
def RPN(operation):
s = []
for el in operation.split(" "):
if el.isdigit():
s.append(el)
elif re.match("[+,-,*,/]", el) and len(s) > 1:
s.append(eval("%s %s %s" % ( s.pop(), el , s.pop() )))
else:
@astagi
astagi / SplashScreenActivity.java
Created February 6, 2013 15:06
Extend this class to transofrm your activity in a splash screen activity for Android!
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
public class SplashScreenActivity extends Activity {
private Handler splashTimeout = new Handler();
private Class<?> cls;
private long time;
@astagi
astagi / build.sh
Created September 13, 2013 20:47
Just a simple script to build your Pebble app and launch the deploy server
#!/bin/sh
./waf build
python -m SimpleHTTPServer 8000