Skip to content

Instantly share code, notes, and snippets.

* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@lyoshenka
lyoshenka / unserialize.js
Last active December 21, 2018 09:39 — forked from brucekirkpatrick/jquery.unserialize.js
Takes a string in format "param1=value1&param2=value2" and returns an javascript object. The opposite of https://api.jquery.com/serialize
/**
* $.unserialize
*
* Takes a string in format "param1=value1&param2=value2" and returns an object { param1: 'value1', param2: 'value2' }. If the "param1" ends with "[]" the param is treated as an array.
*
* Example:
*
* Input: param1=value1&param2=value2
* Return: { param1 : value1, param2: value2 }
*
@lyoshenka
lyoshenka / twerkify-bookmarklet.js
Last active October 22, 2015 19:14 — forked from jacopotarantino/twerkify.js
Twerkify - Make your website twerk.
javascript:!function(){"use strict";function e(){var e,t,a;e=JSON.parse(this.responseText),t=document.querySelectorAll("img"),a=Array.prototype.slice.call(t),a.forEach(function(t){var a=e.data[Math.floor(Math.random()*e.data.length)];t.src=a.images.fixed_height.url})}console.log("Thank you for twerking");var t;t=new window.XMLHttpRequest,t.addEventListener("load",e),t.open("GET","https://api.giphy.com/v1/gifs/search?q=twerking&api_key=dc6zaTOxFJmzC"),t.send()}();
@lyoshenka
lyoshenka / latency.txt
Created February 17, 2016 17:38 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@lyoshenka
lyoshenka / passwordgen.sh
Last active May 17, 2016 13:26 — forked from linuxboytoo/passwordgen.sh
Bash Random Password Generator
#!/bin/bash
head -n100 /dev/urandom | strings | egrep -o '([a-zA-Z0-9#%&^])' | awk '{ORS=""; print $1}' | head -c 35; echo
@lyoshenka
lyoshenka / maintenance.html
Last active October 17, 2017 22:40 — forked from pitch-gist/gist:2999707
Simple Maintenance Page
<!doctype html>
<html><head>
<meta charset="utf-8" />
<title>Site Maintenance</title>
<style type="text/css">
body { padding: 50px 30px 30px; font: 20px Helvetica, sans-serif; color: #222; line-height: 1.4 }
h1 { font-size: 40px; }
article { text-align: left; max-width: 650px; margin: 0 auto; }
a { color: #dc8100; padding: 3px }
a:hover { color: #fff; background-color: #dc8100 }