Skip to content

Instantly share code, notes, and snippets.

<?php
// Fork/clone the full repo @ http://github.com/rbochet/typoXchange
// Romain Bochet
/**
* Allow $fp to be used in getCount
*/
global $fp;
@rbochet
rbochet / printer.sh
Created December 24, 2010 15:36
Shell script for printer cron
#!/bin/bash
# Romain Bochet
# Use as a cron
# Print all the files included in a folder with lp, and move them into another folder.
# Use absolute path (mandatory for crons)
SOURCE="/home/dropbox/print/"
DONE="/home/romain/printed/"
for FILE in `ls $SOURCE`
@rbochet
rbochet / printer.sh
Created December 26, 2010 10:47 — forked from rbochet/printer.sh
Shell script for printer cron (w/ lock)
#!/bin/bash
# Romain Bochet
# Use as a cron
# Print all the files included in a folder with lp, and move them in another folder.
# Use absolute path (mandatory for crons)
SOURCE="/home/dropbox/print/"
DONE="/home/romain/printed/"
LOCK="/tmp/printerlock"
@rbochet
rbochet / strings.xml
Created March 9, 2011 06:28
string.xml wikitionnary
<string name="template_user_agent">"%%s/%%s (Linux; Android)"</string>
<string name="template_wotd_title">"Wiktionary:Word of the day/%%s %%s"</string>
<string name="template_define_url">"http://en.wiktionary.org/wiki/%%s"</string>
@rbochet
rbochet / strings.xml
Created March 9, 2011 06:32
Wikitionnary base
<string name="template_user_agent">"%s/%s (Linux; Android)"</string>
<string name="template_wotd_title">"Wiktionary:Word of the day/%s %s"</string>
<string name="template_define_url">"http://en.wiktionary.org/wiki/%s"</string>
@rbochet
rbochet / .gitignore
Created March 16, 2011 03:48 — forked from kogakure/.gitignore
.gitignore file for LaTeX projects on Mac
# Latex files
*.aux
*.glo
*.idx
*.log
*.toc
*.ist
*.acn
*.acr
@rbochet
rbochet / RunAsRoot.java
Created March 18, 2011 15:59
How to ask for root privileges.
Process root = Runtime.getRuntime().exec("su");
@rbochet
rbochet / MapsApiv3.html
Created March 27, 2011 05:17
Google Maps API v3: LatLngBounds and multiple infoWindows
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />
<title>API Maps v3: Multiple infoWindows and zoom issues</title>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var sites = [
['Darlington', -35.0252820, 138.5630230, 1, 'Darlington, where I am living.<br/><a href="http://www.flickr.com/photos/rbochet/5560158585/" title="Figue agressive de Romain Bochet, sur Flickr"><img src="http://farm6.static.flickr.com/5030/5560158585_c9a6919140_m.jpg" width="240" height="160" alt="Figue agressive" /></a><br/>See my <a href="http://www.flickr.com/photos/rbochet/sets/72157625988396879/">Flickr album</a>'],
@rbochet
rbochet / GoogleChartLoad.sh
Created April 3, 2011 14:06
Should work on every unix, including OSX (doesn't rely on procfs)
max="3";load=$(uptime | cut -d":" -f4 | cut -d" " -f2 | sed s/,/./g);echo "http://chart.apis.google.com/chart?chxr=0,0,"$max"&chxt=y&chs=700x240&cht=gm&chds=0,"$max"&chd=t:"$load"&chl="$load"&chtt=$(hostname | sed s/.local//)+load+average"
@rbochet
rbochet / Logcat.cpp
Created May 8, 2011 06:57
Option cachée dans Logcat
case 'Q':
/* this is a *hidden* option used to start a version of logcat */
/* in an emulated device only. it basically looks for androidboot.logcat= */
/* on the kernel command line. If something is found, it extracts a log filter */
/* and uses it to run the program. If nothing is found, the program should */
/* quit immediately */
#define KERNEL_OPTION "androidboot.logcat="
#define CONSOLE_OPTION "androidboot.console="
{
int fd;