Skip to content

Instantly share code, notes, and snippets.

View Gautier's full-sized avatar

Gautier Hayoun Gautier

View GitHub Profile
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;
@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;
}
#!/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
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>
@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
@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 / 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 / twit.py
Created July 7, 2011 19:40
Group1 code dojo secret sauce
import urllib2
import json
import urllib
API_URL = "http://search.twitter.com/search.json"
def find_a_tweet_without_twitter_stuff(tweets):
for tweet in tweets:
if not ("#" in tweet or "@" in tweet or "http://" in tweet):
yield tweet
@Gautier
Gautier / dalton_base_test.py
Created February 7, 2012 12:56
DaltonTestCase
import os
import dalton
from django.test import TestCase
from django.conf import settings
class DaltonTestCase(TestCase):
ROOT_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)),
"replay")