Skip to content

Instantly share code, notes, and snippets.

😜
Trying to know why...

Parsa Ghadimi qti3e

😜
Trying to know why...
Block or report user

Report or block qti3e

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mika76
mika76 / dataview-polyfill.js
Created Sep 26, 2015
DataView (and ArrayBuffer) polyfill that works in any engine (including old IE).
View dataview-polyfill.js
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 };
@SimonMarquis
SimonMarquis / PreventScreenshot.java
Created Oct 21, 2016
Prevent screenshot on Activity, Dialog, Surface, etc.
View PreventScreenshot.java
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;
/**
View fix_macintosh_portrange.sh
#sudo sysctl -w net.inet.ip.portrange.first=32768
sudo sysctl -w net.inet.ip.portrange.first=12000
sudo sysctl -w net.inet.tcp.msl=1000
sudo sysctl -w kern.maxfiles=1000000 kern.maxfilesperproc=1000000
View orig.js
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))
@rodyhaddad
rodyhaddad / timeago.filter.js
Created Jun 30, 2013
timeago filter for angularjs
View timeago.filter.js
.filter("timeago", function () {
//time: the time
//local: compared to what time? default: now
//raw: wheter you want in a format of "5 minutes ago", or "5 minutes"
return function (time, local, raw) {
if (!time) return "never";
if (!local) {
(local = Date.now())
}
You can’t perform that action at this time.