Skip to content

Instantly share code, notes, and snippets.

View vthibault's full-sized avatar

Vincent Thibault vthibault

View GitHub Profile
@vthibault
vthibault / keytomove.js
Last active November 6, 2016 22:41
roBrowser - Keyboard support to move
// Dependencies
var glMatrix = require('Vendors/gl-matrix');
var Camera = require('Renderer/Camera');
var vec2 = glMatrix.vec2;
var mat2 = glMatrix.mat2;
// Object to initialize
var direction = vec2.create();
var rotate = mat2.create();
@vthibault
vthibault / gethiddenip.js
Created February 24, 2015 16:29
Get IP behind proxy (if available)
var getRealIP = (function() {
"use strict";
function tmp(){}
var RTCPeerConnection = (function getRTC(win, end){
var RTC = win.RTCPeerConnection || win.mozRTCPeerConnection || win.webkitRTCPeerConnection;
if (RTC || end) {
return RTC;
}
@vthibault
vthibault / sandbox.js
Last active August 7, 2017 10:28
Javascript sandbox
/// Hack it ?
function sandbox(code) {
// Disable private functions not listed in window object
var blackList = [
'Function', // avoid using (new Function("code"))(); to get window access
'eval', // ...
'self', // return window object
'window', // ...
];
@vthibault
vthibault / gist:bb30dcda2f61dc6addbf
Created June 2, 2015 09:11
Reverse Javascript2img.com "The Best and Simplest Javascript Obfuscator"
<!DOCTYPE html>
<html>
<head>
<title>Hacking Javascript2img.com</title>
<style type="text/css">
body { font-family:Arial; }
textarea { width:100%; height:300px; }
button { padding:20px; width:150px; height:50px; margin-top:20px; margin-bottom:20px; }
</style>
</head>
@vthibault
vthibault / emoji-detection.js
Last active June 4, 2020 12:09
Detect emoji v2
// https://unicode.org/emoji/charts/full-emoji-list.html
// var list = Array.from(document.querySelectorAll('.chars')).map(t => t.textContent);
const ctx = document.createElement('canvas').getContext('2d');
const CANVAS_HEIGHT = 25;
const CANVAS_WIDTH = 30;
/**
* @var {Object} cache