Skip to content

Instantly share code, notes, and snippets.

View Purexo's full-sized avatar
🦄
I may be slow to respond.

Purexo Purexo

🦄
I may be slow to respond.
View GitHub Profile
@Purexo
Purexo / sp-nginx.conf
Last active August 29, 2015 14:24 — forked from ralmn/sp-nginx.conf
server{
listen *:80;
server_name server.superpowers.ralmn.fr;
location / {
proxy_pass http://127.0.0.1:8001;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
@Purexo
Purexo / Controls.ts
Last active October 29, 2015 15:21
Class pour gerer les control sur Superpowers
/* --- Author ---
@Purexo
/* --- ------ --- */
interface ActionConstructor {
keyboard?: string[];
mButton?: number[];
gamepad?: number[];
gButton?: number[];
gAxis?: number[];
@Purexo
Purexo / daemon
Last active November 14, 2015 12:09
#!/bin/bash
#################################
# Author : Purexo <contact@purexo.eu>
# usage :
# ./script {start|stop|force-stop|restart|reload|force-reload|status}
# number c'est pour le loadbalancing on va avoir plusieurs fois
# le même programme de lancé, faut pouvoir fermer ce que l'on veux
#################################
@Purexo
Purexo / localStorage.js
Created December 2, 2015 17:58
Binding localStorage API to extend the key -> value functionnality with JSON api
/**
* @author : Purexo
* @description : Binding localStorage API to extend the key -> value functionnality with JSON api
* when setItem, data is stringify
* when getItem, data is parsed
* @usage :
* ls.setItem('key', data)
* ls.getItem('key', data)
* ls.removeItem('key')
* ls.key('index')
@Purexo
Purexo / SoundController.ts
Created December 11, 2015 13:52
Superpowers Abstraction Sound
namespace Sound {
export interface contructorSoundController {
MUSIC_PATH: string;
SOUND_PATH: string;
// musics['category']['nom'] = 'relative/path/from/MUSIC_PATH'
// tableau associatif de tableau associatif
musics: {
[index: string]: {
[index: string] : string
@Purexo
Purexo / ModuleParticule
Created February 12, 2016 10:09
Superpowers-script-ModuleParticule
module Particule {
class Color extends Sup.Color {
static random () {
let Random = Sup.Math.Random;
return new Color(
Random.integer(0, 100) / 100,
Random.integer(0, 100) / 100,
Random.integer(0, 100) / 100
);
}
@Purexo
Purexo / SimpleEventManager.js
Last active October 21, 2016 12:17
A simple event manager JS (browser) with an simple API like socket.io : on and emit function
'use strict';
/**
* SimpleEventManager is a simple API for create and listen Event
* It's a superset of DOM Event listening API
*
* Example :
let event = new SimpleEventManager(function(lastState) {
// watched variable
@Purexo
Purexo / CandyBox-AutoSave-AutoQuest-UserScript.js
Last active October 21, 2016 14:44
UserScript for Candy Box 1. AutoSave and AutoQuest ^^
// ==UserScript==
// @name CandiBox 1 - AutoSave
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Purexo
// @require https://gist.githubusercontent.com/purexo/0d27aad481158047ae852dc10d779cd9/raw/bc931c67e74d5d9d9d205ea456bc52d64f94e124/SimpleEventManager.js
// @include http://candies.aniwey.net/*
// @grant none
// ==/UserScript==
@Purexo
Purexo / svgtopng.sh
Last active November 8, 2016 15:59
a little bash script (need inkscape installed) for transform svg in png
#!/bin/bash
# Default Parameters
pattern="*.svg"
output="./svgtopng-output"
x=false
width="128"
y=false
height="128"
const handlerStorage = {
get(target, key) {
const value = target.getItem(key);
try {
return JSON.parse(value);
} catch (e) {
return value;
}
},