Skip to content

Instantly share code, notes, and snippets.

View revolunet's full-sized avatar
🐫
Killing bugz

Julien Bouquillon revolunet

🐫
Killing bugz
View GitHub Profile
@revolunet
revolunet / translate3d.js
Last active December 19, 2015 12:49
Javscript extract translate3d coordinates
function getTransformCoordinates(el) {
var results = angular.element(el).css('-webkit-transform').match(/translate3d\((-?\d+(?:px)?),\s?(-?\d+(?:px)?),\s?(-?\d+(?:px)?)\)/)
if(!results) return [0, 0, 0];
return results.slice(1, 3);
}
@revolunet
revolunet / mobile.css
Created July 10, 2013 07:49
some mobile css fixes
html {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-touch-callout: none;
-webkit-user-drag: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
@revolunet
revolunet / update.sh
Created July 23, 2013 08:23
Django project auto-update & restart script with virtualenv support
#!/bin/bash
#
# this script should be placed at the same level as the django project root folder
#
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $VIRTUALENVWRAPPER_HOOK_DIR/PROJECT/bin/activate
cd $DIR/PROJECT
git pull
chown -R www-data ./static/media
@revolunet
revolunet / dabblet.css
Created August 2, 2013 23:00 — forked from LeaVerou/dabblet.css
Switch-style checkboxes.
/**
* Switch-style checkboxes.
* Inspired by Espresso’s “Tools” switch
*/
input[type="checkbox"]:not(:checked),
input[type="checkbox"]:checked { /* :checked here acting as a filter for older browsers */
position: absolute;
opacity: 0;
}
@revolunet
revolunet / countries-FR.json
Last active July 22, 2024 13:18
Liste des pays en FR
{
"AF": "Afghanistan",
"ZA": "Afrique du Sud",
"AL": "Albanie",
"DZ": "Algérie",
"DE": "Allemagne",
"AD": "Andorre",
"AO": "Angola",
"AI": "Anguilla",
"AQ": "Antarctique",

Place : At Le Players

Talks (~2h)

  • Phonegap Presentation & success stories (10mins)
  • jQueryMobile by Frédéric Falliere (15mins)
  • GWT + Phonegap by Cyrille Savelief (15mins)
  • AngularJS for mobile by Julien Bouquillon (15mins)
  • PG CLI tools by Michael Brooks (20mins)
  • The new plugin architecture by Anis Kadri (20mins)
  • TopCoat by Kristofer Joseph (45mins)
@revolunet
revolunet / proxy.js
Created August 13, 2013 14:38
simple node http proxy
var http = require('http'),
httpProxy = require('http-proxy');
var options = {
changeOrigin: true,
target: {
port: 80,
host: 'dev.website'
}
};
@revolunet
revolunet / .htaccess
Last active January 31, 2019 11:09
global enable CORS without touching code
# with AJAX withCredentials=false (cookies NOT sent)
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "POST, GET, PUT, OPTIONS, PATCH, DELETE"
Header always set Access-Control-Allow-Headers "X-Accept-Charset,X-Accept,Content-Type"
RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L,E=HTTP_ORIGIN:%{HTTP:ORIGIN}]]
# with AJAX withCredentials=true (cookies sent, SSL allowed...)
SetEnvIfNoCase ORIGIN (.*) ORIGIN=$1
@revolunet
revolunet / dabblet.css
Created August 27, 2013 23:54
Lea Verou iOS checkbox based pure CSS switch (slow on mobile devices :/)
* {
-webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */
-webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */
-webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
-webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */
}
:root input[type="checkbox"].ios-switch { /* :root here acting as a filter for older browsers */
position: absolute;
opacity: 0;
@revolunet
revolunet / controller.spec.js
Last active April 23, 2018 08:02
Jasmine test angular-translate calls
/*
silly way to ensure $translate service has been called with correct key and arguments
*/
var $translate;
beforeEach(inject(function (_$translate_) {
$translate = function() {
$translate.spy.apply(this, arguments);
};
$translate.spy = function() {};