Skip to content

Instantly share code, notes, and snippets.

View gist:2374794
function parseq(s) {
var o = {};
s.split("&").map(function (e) {
var
p = e.indexOf("="),
t = [e.substring(0, p), e.substring(p + 1)],
m = /^(\w+)\[['"](\w+)['"]\]$/.exec(t[0]);
if (m) {
o[m[1]] = o[m[1]] || {};
@m1el
m1el / out.json
Created Jun 27, 2012
JScript madness
View out.json
[{
"type": 0,
"hmenu": 66707,
"id": 121,
"submenu": [{
"type": 256,
"hmenu": 66709,
"id": 122,
"submenu": 0,
"text": "&Изменить атрибуты..."
View gist:5037894
F = '86670S050s0Sp`0Js5)LxeT0)0C0.Rsh,Jfc02020.RsiW090,Rsh:00T#*jge0bRQQdxKhvs0QQC00b9l)Wfc0pw`00S0C0Sg[%ege%S00cg[ j-Dsts0SJfc0S\n$qtud0TbR$\n+.0)*ZgV0)JWeT0sIRcgK0/Xfb4\\v'.split(0);
f = "`00000000spring00000000`00000000is0in0the0air0000000write0here00000000000000000";
for (Z in a)
a[Z[0] + (Z[6] || Z[2])] = a[Z];
W = c.width = 375;
H = c.height = 500;
Z = b.bgColor = 12;
with(a) {
L = function (d, h, g, e) {
ba();
@m1el
m1el / youtube-dl-map.coffee
Last active Dec 14, 2015
youtube dl links
View youtube-dl-map.coffee
fmt_map = ytplayer.config.args.url_encoded_fmt_stream_map.split(',').map (e) ->
e.split('&').reduce (p, c) ->
c = c.split('=')
p[c[0]] = unescape(c[1])
p
, {}
dl_map = fmt_map.reduce (p, c) ->
p["#{c.quality}/#{c.type}"] = "#{c.url}&signature=#{c.sig}"
p
View timeNN.js
// time07
(function (e) {
"use strict";
function t() {
this.data = {}
}
function n() {
this.listeners = new t
}
@m1el
m1el / manifest.json
Created Mar 27, 2013
another google search nospy
View manifest.json
{
"manifest_version": 2,
"content_scripts": [ {
"js": [ "script.js" ],
"matches": [
"http://*.google.com/*", "https://*.google.com/*",
"http://*.google.com.ua/*", "https://*.google.com.ua/*",
"http://*.google.ru/*", "https://*.google.ru/*"
]
} ],
@m1el
m1el / fork-with-recursive-check.js
Last active Dec 17, 2015
Deep object clone without recursion with recursion objects check
View fork-with-recursive-check.js
var fork = function (source, unsafe) {
var
objmap = unsafe ? null : new Map(),
targetOut = {__proto__: source.__proto__},
target,
stack = {0: {source: source, target: targetOut}},
sp = 0,
ss = 1,
keys, key, j, scope, tmp;
while ((scope = stack[sp++])) {
@m1el
m1el / cp1251-query.js
Last active Dec 18, 2015
#query #cp1251 #encoder
View cp1251-query.js
// License = MIT
var encodeCp1251 = (function(){
var alphabet = 'АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя';
function replacefn(c) {
var i = alphabet.indexOf(c);
if (i > -1) {
return '%' + (i + 0xc0).toString(16);
}
if (c.charCodeAt(0) < 128) {
return escape(c);
View object-keys-fallback.js
if (!Object.keys) {
Object.keys = function(obj) {
var keys = [];
for (var k in obj) {
if (obj.hasOwnProperty(k)){
keys.push(k);
}
}
return keys;
}