Skip to content

Instantly share code, notes, and snippets.

View francois-dibulo's full-sized avatar

Francois francois-dibulo

View GitHub Profile
@francois-dibulo
francois-dibulo / airconsole-api-extension.js
Last active April 23, 2022 17:00
Helper functions for the AirConsole API
/**
* Extending AirConsole with useful helper functions
* Include this script after the AirConsole API
* @author francois@n-dream.com
*/
(function() {
if (!window['AirConsole']) {
throw "AirConsole is not defined. Did you not include the API file?";
/**
* EventHandler.js
*
* @description Extends object with .on(), .off() and .emit() methods
* @author: francois@n-dream.com
* @constructor
* @param {Object} source - The object to extend with events
*/
var EventHandler = function() {
@francois-dibulo
francois-dibulo / bash_profile
Last active February 3, 2017 08:04
Bash-Profile Useful Commands (Mac OS)
### GIT ###
# Show not merged branches
alias gitnotmerged="git branch --no-merged master"
# Delete all merged branches
alias gitclean='git branch --merged | grep -v "\*" | xargs -n 1 git branch -d'
# Update all submodules
alias gitupdatesub="git submodule foreach git pull origin master"
@francois-dibulo
francois-dibulo / Main.sublime-menu
Last active February 1, 2017 14:23
Open Project in AirConsole Simulator - Sublime Plugin
[
{
"caption": "AirConsole",
"mnemonic": "A",
"id": "OpenAirConsole",
"children":
[
{
"caption": "Open simulator",
"command": "open_air_console"
@francois-dibulo
francois-dibulo / device_hammer.js
Created August 12, 2015 14:43
HammerDeviceMotion
/**
* @author Francois Weber - V 1.0
* Reading device motion to use phone as 'hammer'
*
* How to:
* var hammer = new DeviceHammer();
* // Overwrite:
* hammer.onHit = function() { yourCode() };
*
* @param {Object} options
<html>
<head>
<script type="text/javascript"
src="https://www.airconsole.com/api/airconsole-1.7.0.js"></script>
<script type="text/javascript">
navigator.vibrate = (navigator.vibrate ||
navigator.webkitVibrate ||
navigator.mozVibrate ||
navigator.msVibrate);