Skip to content

Instantly share code, notes, and snippets.

View steren's full-sized avatar
🏃‍♀️

Steren steren

🏃‍♀️
View GitHub Profile
@steren
steren / camping-mafia-extractor.js
Last active August 29, 2015 13:59
Extract data from lecampingmafia.com
var rows = [];
$('table.startups tr').each(function(i, n){
var $row = $(n);
var connect = {};
$row.find('td.connect a').each(function(j, m){
var href = $(m).attr('href');
var key = 'contact';
@steren
steren / app.yaml
Last active August 29, 2015 14:24
Serve only static files with Google AppEngine (like on GitHub pages)
# Add this file at the root of your directory,
# and your static files in a public/ folder.
# Use 'gcloud preview app deploy .' to publish to AppEngine.
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /(.+)
@steren
steren / RenderSitemap.java
Created April 13, 2011 15:36
Create a controller and a generator to create your sitemap
package helpers;
public class RenderSitemap extends RenderSitemapXml {
public RenderSitemap(List<User> users) {
super(getDocument(users));
}
private static Document getDocument(List<User> users) {
Document doc = createSiteMapDocument();
@steren
steren / Dives.html
Created August 26, 2011 20:14
Convert an export from Google spreadsheets to JSON objects, used for my diving log.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script url="http://ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.js" ></script>
<script src="http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"></script>
<script type="text/javascript">
@steren
steren / voyagessncf.css
Created February 9, 2012 21:52
voyages-sncf.com more is less
@-moz-document domain("voyages-sncf.com") {
/* Delete */
/* main */
#l_foot,
#actu,
#eco-searchform,
#promos,
#block-links,
@steren
steren / screens.java
Created March 1, 2012 13:57
Android screen size
// if API level > 13, we can use this:
// Point outSize = new Point();
// display.getSize(outSize);
DisplayMetrics displaymetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
int ht = displaymetrics.heightPixels;
int wt = displaymetrics.widthPixels;
// Determine screen size
@steren
steren / imageprocessing-boilerplate.html
Created June 25, 2012 23:01
Image processing JS boilerplate for Xavier
<p>Code to help you with <a href="http://www.html5rocks.com/en/tutorials/canvas/imagefilters/">this tutorial</a>.</p>
<p>To manipulate image pixels, run Chrome with "web security" disabled. On a mac, terminate your existing Chrome, then type in a terminal: <code>$ open -a Google\ Chrome --args --disable-web-security</code></p>
<figure>
<img id="orig" src="http://www.html5rocks.com/en/tutorials/canvas/imagefilters/demo_small.png" width="600" height="337">
<figcaption>The original test image</figcaption>
</figure>
<h2>Processing pixels</h2>
@steren
steren / onlyone.html
Created January 26, 2013 00:03
Josephus problem illustration and formula test
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<link type="text/css" rel="stylesheet" href="http://code.shutterstock.com/rickshaw/src/css/graph.css">
<script src="http://code.shutterstock.com/rickshaw/vendor/d3.v2.js"></script>
<script src="http://code.shutterstock.com/rickshaw/rickshaw.js"></script>
<meta charset=utf-8 />
@steren
steren / SSE DEMO.md
Last active December 16, 2015 14:49

Simple example of Server Send Events By Steren Giannini for Paris JS

@steren
steren / poker.js
Last active January 9, 2016 17:06
Poker Tournament manager script to be used with Google Spreadsheet
// Poker Tournament script
// by Steren Giannini http://www.steren.fr
// # How to use
// Use "=computePlayerScoreAndRank()" to generate a tournament ladder, as first argument select a column of player name, as second argument, select the cells of game
/////////////
// Variables
/////////////