Skip to content

Instantly share code, notes, and snippets.

@tkhduracell
tkhduracell / PyStrapper.py
Last active August 29, 2015 13:57
A small Python class to build Bootstrap html documents with a pretty function syntax.
from datetime import datetime
import os
import types
import functools
import my_utils
class PyStrapper:
name = ""
@tkhduracell
tkhduracell / SteroMixVis.py
Last active August 29, 2015 14:02
Using LightPack to visualize SteroMix (music and games) on Windows
import lightpack
import time
import random
import pyaudio # from http://people.csail.mit.edu/hubert/pyaudio/
import audioop
import sys
import math
def list_devices():
@tkhduracell
tkhduracell / compare_php_ini.py
Created June 14, 2014 21:24
Compare two php.ini files using Python
#!/usr/bin/python
import re
import argparse
def main():
parser = argparse.ArgumentParser(description='Compare two php.ini files')
parser.add_argument('file1', metavar='first_php_ini', type=str, help='First file to compare')
parser.add_argument('file2', metavar='second_php_ini', type=str, help='Second file to compare')
@tkhduracell
tkhduracell / email.spec.rb
Last active August 29, 2015 14:05
Capybara::Email Cheatsheet
# Returns the currently set email.
current_email
# Returns a collection of all current emails retrieved.
current_emails
# Access all emails.
all_emails
# Clear the email queue.
@tkhduracell
tkhduracell / date_rename.py
Created August 30, 2014 13:54
Rename all files to yyyy-mm-dd hh.mm.ss format, using EXIF if possible
#!/usr/bin/python
import sys
import hashlib
import os
import fnmatch
import json
import time
import datetime
import my_utils
import urllib
@tkhduracell
tkhduracell / LifeCycleDebugger.java
Last active August 29, 2015 14:06
Debug Android lifecycles
/**
* getApplication().registerActivityLifecycleCallbacks(new LifeCycleDebugger());
*/
public class LifeCycleDebugger implements Application.ActivityLifecycleCallbacks {
@Override
public void onActivityStopped(Activity activity) {
Log.i(activity.getLocalClassName(), "onActivityStopped");
}
@Override
@tkhduracell
tkhduracell / install_android.sh
Last active August 29, 2015 14:12
Android on unix
wget http://dl.google.com/android/android-sdk_r24.0.2-linux.tgz
tar -xf android-sdk_r24.0.2-linux.tgz
rm android-sdk_r24.0.2-linux.tgz
cd android-sdk-linux
( sleep 5 && while [ 1 ]; do sleep 1; echo y; done ) | android update sdk --no-ui --filter platform-tool,extra-android-support,android-21,sysimg-21,build-tools-21.1.2
android update sdk --no-ui
@tkhduracell
tkhduracell / trusty_jenkins_android.sh
Last active August 29, 2015 14:13
My Jenkins: CasperJS, AndroidSDK
wget http://dl.google.com/android/android-sdk_r24.0.2-linux.tgz
tar -xf android-sdk_r24.0.2-linux.tgz
rm android-sdk_r24.0.2-linux.tgz
cd android-sdk-linux
( sleep 5 && while [ 1 ]; do sleep 1; echo y; done ) | android update sdk --no-ui --filter platform-tool,extra-android-support,android-21,build-tools-21.1.2
android update sdk --no-ui
@tkhduracell
tkhduracell / README.md
Last active January 2, 2019 05:34
Configure Google Hangout notifications on Jenkins

Install plugins

  • instant-messaging plugin
  • Jabber Plugin plugin

Jenkins > Manage Jenkins > Configure System > Jabber Notification

  • Enable Jabber Notification
  • Jabber ID: <[email protected]>
  • Password: <your password>
  • Advanced
  • Server: talk.google.com
@tkhduracell
tkhduracell / fix.sh
Last active September 16, 2024 07:15
Fix locale on raspberry pi (raspbian) "Setting locale failed."
#
# How to get rid of the locale warning on raspberry pi
#
sudo sed -i "s/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g" -i /etc/locale.gen
sudo locale-gen en_US.UTF-8
sudo update-locale en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8