Skip to content

Instantly share code, notes, and snippets.

Avatar

Vincent Thibault vthibault

View GitHub Profile
View emoji-detection.js
// 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
@vthibault
vthibault / gist:bb30dcda2f61dc6addbf
Created Jun 2, 2015
Reverse Javascript2img.com "The Best and Simplest Javascript Obfuscator"
View gist:bb30dcda2f61dc6addbf
<!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 / sandbox.js
Last active Aug 7, 2017
Javascript sandbox
View sandbox.js
/// 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 / gethiddenip.js
Created Feb 24, 2015
Get IP behind proxy (if available)
View gethiddenip.js
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 / keytomove.js
Last active Nov 6, 2016
roBrowser - Keyboard support to move
View keytomove.js
// 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();