Skip to content

Instantly share code, notes, and snippets.

@Zirak
Zirak / result.org
Last active August 29, 2015 14:02

Vote results:

commandvotes
awsm16
norris14
domain13
zalgo13
meme11
inhistory9
todo8
@Zirak
Zirak / gist:cd319399c89e230c60a4
Last active September 7, 2016 16:23
Method overriding in js prototypical inheritance with proxies

So

you have an object.

var o = {
    a : 4,

    log : function () {
        console.log('a:', this.a);
    }
@Zirak
Zirak / blockingJS2.php
Last active September 7, 2016 16:28
Testing browser load order and blockingness
<?php
header('Content-Type: text/javascript');
sleep(4);
?>
console.log('2');
var ids = $('#access-section-read-write .usercard').map(function () { return /\d+/.exec(this.id); }).toArray()
function remove (userId, cb) {
$.post('/rooms/setuseraccess/17', fkey({
aclUserId : userId,
userAccess : 'remove'
})).always(cb);
}
(function step (ids) {
"use strict";
var req = require('request' ),
opts = require('./config.json');
twoStepLogin(
'https://openid.stackexchange.com/account/login',
'https://openid.stackexchange.com/account/login/submit');
function twoStepLogin (loginUrl, submitUrl, next) {
{
"420": {
"name": "420",
"output": "<>hehe he hehehehe hehe he hehehe he...",
"input": "/.*/",
"creator": "rlemon",
"date": "2014-03-04T23:21:27.645Z",
"description": "User-taught command: `<>hehe he hehehehe hehe he hehehe he...`"
},
"666": {
var Dictionary = {
new : function () {
var ret = Object.create(this);
ret.data = {};
return ret;
},
set : function (key, value) {
this.data[key] = value;

So you have a javascript function.

function func () {}

It accepts a value.

function func (param) {}
//a trivial doubly-linked list implementation
#include <stdio.h>
#include <stdlib.h>
typedef struct Node {
struct Node* next;
struct Node* previous;
int value;
@Zirak
Zirak / gist:6845273
Created October 5, 2013 19:42
An antivirus for Jhawins
var a=function(b){var c;0==b?c="PT09PSBBViBCbHVlSmF5IFBybzogTUVHQVRST04gRURJVElPTiA9PT09":1==b?c="TGljZW5zZSBlVzkxY2lCaWIyOWljeUJoY21VZ1pHVnNhV05wYjNWeg==":2==b?c="ClNDQU5OSU5HIENPTVBVVEVSIEZPUiBWSVJVU0VTLi4u":3==b?c="Cgo9PT0gU0NBTiBDT01QTEVURSA9PT0=":4==b?c="Q09NUFVURVIgQ0xFQU4=":5==b?c="VEhBTktTIEZPUiBVU0lORyBBViBCbHVlSmF5IFBybzogTUVHQVRST04gRURJVElPTg==":6==b?c="REVURUNURUQgJXMgVklSVVNFUw==":7==b?c="Q0xFQU5JTkcgQ09NUFVURVIuLi4=":8==b?c="CgpDTEVBTlVQIENPTVBMRVRF":9==b?c="REVMRVRFRCBBTEwgVklSVVNFUw==":
10==b&&(c="Li4u");console.log.apply(console,[atob(c)].concat([].slice.call(arguments,1)))};a(0);a(1);a(2);setTimeout(function(){a(3);if(0.5>Math.random())a(4),a(5);else{var b=Math.floor(42*Math.random());a(6,b);a(7);setTimeout(function(){a(8);a(9);a(5)},aDots(4*b))}},aDots(60));function aDots(b){b=1E3*(Math.floor(4*Math.random())+b);var c=Date.now()+b,d=setInterval(function(){Date.now()>=c?clearInterval(d):a(10)},5E3);return b};