Skip to content

Instantly share code, notes, and snippets.

View xtuc's full-sized avatar

Sven Sauleau xtuc

View GitHub Profile
@xtuc
xtuc / testApplet.java
Last active September 28, 2015 11:27
Java card
package testPackage;
/*
* Package: testPackage
* Filename: TestApplet.java
* Class: TestApplet
* Date: [[10 June]] of [[2015]] 14:55:52
*/
@xtuc
xtuc / script.php
Created October 13, 2015 12:32
How to use OVH API to enable network burst on SBG1 servers?
<?php
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;
// Informations about your application
$applicationKey = "your_app_key";
$applicationSecret = "your_app_secret";
$consumer_key = "your_consumer_key";
// Information about API and rights asked
@xtuc
xtuc / script.js
Created October 13, 2015 12:54
JavaScript VM
typeof null // object
null instanceof Object // false
@xtuc
xtuc / script.js
Created October 13, 2015 12:54
JavaScript VM
typeof null // object
null instanceof Object // false
@xtuc
xtuc / utils.scala
Last active November 20, 2015 11:01
Have fun with Scala
def compose[A,B,C](f: B => C, g: A => B): A => C =
a => f(g(a))
def curry[A,B,C](f: (A, B) => C): A => (B => C) =
a => b => f(a, b)
def uncurry[A,B,C](f: A => B => C): (A, B) => C =
(a, b) => f(a)(b)
@xtuc
xtuc / UPGRADE-7.0.md
Last active February 1, 2018 22:11
Upgrade guide for Babel 7
public class Test {
public static void main(String[] args) {
System.out.println(10 − 4);
}
}
@xtuc
xtuc / foo.js
Last active February 7, 2017 14:38
type Args = {
a: number,
b: number,
c: number,
};
function add({ a, b, c }: Args) {
return a + b + c;
}
@xtuc
xtuc / Babel.md
Last active April 17, 2019 04:43

Path

remove

Removes the current path.

Example

Visistor:

var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super e