Skip to content

Instantly share code, notes, and snippets.

View qti3e's full-sized avatar
😃

Parsa qti3e

😃
View GitHub Profile
@mika76
mika76 / dataview-polyfill.js
Created September 26, 2015 21:27
DataView (and ArrayBuffer) polyfill that works in any engine (including old IE).
void function(global){
if ('DataView' in global && 'ArrayBuffer' in global) {
return;
}
var hide = (function(){
// check if we're in ES5
if (typeof Object.getOwnPropertyNames === 'function' && !('prototype' in Object.getOwnPropertyNames)) {
var hidden = { enumerable: false };
@awjuliani
awjuliani / Q-Net Learning Clean.ipynb
Created August 25, 2016 20:30
Basic Q-Learning algorithm using Tensorflow
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@SimonMarquis
SimonMarquis / PreventScreenshot.java
Created October 21, 2016 08:23
Prevent screenshot on Activity, Dialog, Surface, etc.
import android.app.Activity;
import android.app.Dialog;
import android.app.Fragment;
import android.os.Build;
import android.support.annotation.RequiresApi;
import android.view.SurfaceView;
import android.view.Window;
import android.view.WindowManager;
/**
@qti3e
qti3e / README.md
Last active April 13, 2024 15:50
List of file signatures and mime types based on file extensions
@ry
ry / orig.js
Created January 19, 2018 04:56
import { grad, linspace, plot } from "propel";
f = x => x.tanh();
x = linspace(-4, 4, 200);
plot(x, f(x),
x, grad(f)(x),
x, grad(grad(f))(x),
x, grad(grad(grad(f)))(x),
x, grad(grad(grad(grad(f))))(x))
@stevendesu
stevendesu / HMAC.js
Created April 30, 2020 16:18
A simple, open-source, HMAC-SHA256 implementation in pure JavaScript. Designed for efficient minification.
// To ensure cross-browser support even without a proper SubtleCrypto
// impelmentation (or without access to the impelmentation, as is the case with
// Chrome loaded over HTTP instead of HTTPS), this library can create SHA-256
// HMAC signatures using nothing but raw JavaScript
/* eslint-disable no-magic-numbers, id-length, no-param-reassign, new-cap */
// By giving internal functions names that we can mangle, future calls to
// them are reduced to a single byte (minor space savings in minified file)
var uint8Array = Uint8Array;