Skip to content

Instantly share code, notes, and snippets.

View Gautier's full-sized avatar

Gautier Hayoun Gautier

View GitHub Profile
@Gautier
Gautier / todo.sh
Created May 21, 2011 11:56 — forked from AdrienLemaire/todo.sh
Find all the TODO in a django/android project which need to be fixed
#!/bin/sh
# Find all the TODO in the code which need to be fixed
# Android
if [ -f AndroidManifest.xml ]; then
echo '\nJava'
git grep -In "\(TODO\)\|\(XXX\)" -- '*.java'
echo "Resources"
git grep -In "\(TODO\)\|\(XXX\)" -- '*.xml'
@Gautier
Gautier / fields.py
Created May 19, 2011 12:01
Yes No boolean field for
from django import forms
class YesNoNullBooleanSelect(forms.Select):
"""
A Select Widget intended to be used with YesNoBooleanField.
"""
def value_from_datadict(self, data, files, name):
value = data.get(name, None)
return {u'2': True,
@Gautier
Gautier / CountDownTimer.java
Created December 12, 2010 00:58
Drop-in alternative for the Android CountDownTimer class, but which you can cancel from within onTick.
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
Index: sources/rtmpserver/src/rtmpserver.cpp
===================================================================
--- sources/rtmpserver/src/rtmpserver.cpp (revision 1315)
+++ sources/rtmpserver/src/rtmpserver.cpp (working copy)
@@ -27,6 +27,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <stdlib.h>
+#include <execinfo.h>
#!/usr/bin/env python
import ConfigParser
import random
import sys
import time
import numpy
import pygame, pygame.locals
#!/usr/bin/env python
import ConfigParser
import random
import sys
import time
import numpy
import pygame, pygame.locals
@Gautier
Gautier / pendulum.js
Created March 16, 2010 00:13
Javascript pendulum CSS3
/**
* Oh yeah
*/
function rotate(id) {
var element = document.getElementById(id);
function applyRotate(angle) {
var strAngle = "rotate(" + angle + "rad)";
element.style.WebkitTransform = strAngle;
element.style.MozTransform = strAngle;
}
package com.fryit.snapexpense;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.Service;
import android.util.Log;