Skip to content

Instantly share code, notes, and snippets.

View jvelo's full-sized avatar
🦉
transient

Jerome Velociter jvelo

🦉
transient
View GitHub Profile
@jvelo
jvelo / ajaxifiedPopupForm.js
Created August 31, 2011 20:04
AjaxifiedPopupForm widget for XWiki
var XWiki = (function(XWiki){
/**
* Widget that takes a popup with a form in its content and auto-magically ajaxifies this form.
*/
XWiki.AjaxifiedPopupForm = Class.create({
/**
* Some default options.
*/
@jvelo
jvelo / hack.sh
Created March 31, 2012 17:48 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@jvelo
jvelo / stallwall.user.js
Created November 14, 2012 21:11
Your not so computer-literate friends gonna love it >;)
/**
* stallwall.user.js @jvelo 2012-2013
*
* At a friend's place :
*
* 1. Open chrome://chrome/extensions/ in chrome
* 2. Drag in there this script
* 3. ???
* 4. Profit !
*/
@jvelo
jvelo / directive.js
Created February 15, 2013 20:31
Small directive to create an AngularJS switch button with Twitter Bootstrap + jQuery
myApp.directive('switchButton', function() {
return {
require: 'ngModel',
restrict: 'E',
template: '<div class="btn-group">' +
'<button class="btn on" ng-click="on()"></button>' +
'<button class="btn off" ng-click="off()"></button>' +
'</div>',
link: function($scope, element, attrs, controller) {
$scope.on = function() {
@jvelo
jvelo / Pest.php
Created May 15, 2013 21:39
Mayocat marketplace API sample client in PHP
<?php // -*- c-basic-offset: 2 -*-
/**
* Pest is a REST client for PHP.
*
* See http://github.com/educoder/pest for details.
*
* This code is licensed for use, modification, and distribution
* under the terms of the MIT License (see http://en.wikipedia.org/wiki/MIT_License)
*/
@jvelo
jvelo / backup.sh
Last active December 25, 2015 10:59
#!/bin/bash
MY_DIR=`dirname $0`
. $MY_DIR/backups.conf
DAY_OF_WEEK=`date +%A | tr '[:upper:]' '[:lower:]'`
WEEK_OF_YEAR=`date +%V`
BACKUP_DIRECTORY=/home/$BACKUP_USER/backups/daily/$DAY_OF_WEEK
WEEKLY_BACKUP=/home/$BACKUP_USER/backups/weekly
@jvelo
jvelo / oraclejre6.pp
Created January 15, 2014 14:50
Oracle Java 6 via puppet
class oraclejre6 {
apt::source { 'webupd8team':
location => 'http://ppa.launchpad.net/webupd8team/java/ubuntu',
release => 'precise',
repos => 'main',
required_packages => 'debian-keyring debian-archive-keyring',
key => 'EEA14886',
key_server => 'keyserver.ubuntu.com',
pin => '-10',
@jvelo
jvelo / Endpoints
Last active January 4, 2016 19:09
Catalog API design
GET /api/products/my-tshirt
GET /api/products/my-tshirt/features/
GET /api/products/my-tshirt/features/size/
GET /api/products/my-tshirt/features/size/xs
GET /api/products/my-tshirt/features/color/red
GET /api/products/my-tshirt/variants/
GET /api/products/my-tshirt/variants/xs-red
PUT /api/products/my-tshirt/features/size/xs
POST /api/products/my-tshirt/features/color/ -> 201 created /api/products/my-tshirt/features/color/yellow
@jvelo
jvelo / ngtap.js
Created April 15, 2014 13:03
A better ng-tap
myapp.directive("ngTap", ['$parse', function($parse) {
return {
link: function ($scope, $element, $attributes) {
var fun = $parse($attributes["ngTap"])
if (!('ontouchstart' in document.documentElement)) {
$element.bind("click", function (event) {
return $scope.$apply(function () {
fun($scope, {$event: event});
});
});

Comparison of the size of some of java JSON mapping libraries

Artifact Size
org.json:json:20141113 64 KB
org.glassfish:javax.json:1.0.4 84 KB + 20KB (javax.json:javax.json-api)
com.fasterxml.jackson.jr:jackson-jr-all:2.6.0 327 KB
com.fasterxml.jackson.core:jackson-databind:2.6.0 1.2 MB + 253KB (com.fasterxml.jackson.core:jackson-core:2.6.0) + 46 KB (com.fasterxml.jackson.core:jackson-annotations:2.6.0)
com.google.code.gson:gson:2.3.1 206 KB
com.googlecode.json-simple:json-simple:1.1.1 24 KB