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 / 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 / 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 / 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 / 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 / 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 / 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.
*/