Skip to content

Instantly share code, notes, and snippets.

@azder
azder / zonedIso.js
Created February 4, 2023 10:18
convert Date object to ISO string with zone info
const n = $ => Number.isNaN($);
const p = $ => {
if ($ < 1) {
return '00';
}
if ($ < 10) {
return '0' + $;
}
return '' + $;
@azder
azder / firefox-tocyrillic-extension.txt
Last active September 6, 2018 10:44
mk-transliteration
extensions.tocyrillic.layouts.macedonianutf8.description = Macedonian – UTF8 (Џ = Dž)
extensions.tocyrillic.layouts.macedonianutf8 = [["gj","ѓ"],["è","Ѐ"],["`e","Ѐ"],["e'","Ѐ"],["e`","Ѐ"],["ž","Ж"],["zh","Ж"],["zj","Ж"],["dz","ѕ"],["ì","Ѝ"],["`i","Ѝ"],["i'","Ѝ"],["i`","Ѝ"],["lj","Љ"],["ly","Љ"],["nj","Њ"],["ny","Њ"],["ć","ќ"],["kj","ќ"],["ky","ќ"],["ќ","Ќ"],["č","Ч"],["ch","Ч"],["cj","Ч"],["dž","Џ"],["dzh","Џ"],["dzj","Џ"],["š","Ш"],["sh","Ш"],["sj","Ш"],["a","А"],["b","Б"],["v","В"],["g","Г"],["d","Д"],["e","Е"],["z","З"],["i","И"],["j","Ј"],["k","К"],["l","Л"],["m","М"],["n","Н"],["o","О"],["p","П"],["r","Р"],["s","С"],["t","Т"],["u","У"],["f","Ф"],["h","Х"],["c","Ц"]]
extensions.tocyrillic.layouts.macedonianlatin1.description = Macedonian – Latin 1 (Џ = Dzh)
extensions.tocyrillic.layouts.macedonianlatin1 = [["gj","ѓ"],["e'","Ѐ"],["`e","Ѐ"],["e`","Ѐ"],["è","Ѐ"],["zh","Ж"],["zj","Ж"],["ž","Ж"],["dz","ѕ"],["i'","Ѝ"],["`i","Ѝ"],["i`","Ѝ"],["ì","Ѝ"],["lj","Љ"],["ly","Љ"],["nj","Њ"],["ny","Њ"],["kj","ќ"],["ky"
switching bars
@azder
azder / optionals
Created March 27, 2018 10:33
Optional and mandatory values in JS functions
const mandatory = (
message => {
throw new Error(message);
}
);
function f({
optional = 'not provided',
required = mandatory('the parameter "required" must not be null or undefined'),
(1) It Has To Work.
(2) No matter how hard you push and no matter what the priority,
you can't increase the speed of light.
(2a) (corollary). No matter how hard you try, you can't make a
baby in much less than 9 months. Trying to speed this up
*might* make it slower, but it won't make it happen any
quicker.
@azder
azder / from-dictobject.c
Created February 16, 2018 19:47
svn.python.org/view/python/trunk/Objects/dictobject.c?rev=53656
/*
Major subtleties ahead: Most hash schemes depend on having a "good" hash
function, in the sense of simulating randomness. Python doesn't: its most
important hash functions (for strings and ints) are very regular in common
cases:
>>> map(hash, (0, 1, 2, 3))
[0, 1, 2, 3]
>>> map(hash, ("namea", "nameb", "namec", "named"))
[-1658398457, -1658398460, -1658398459, -1658398462]
@azder
azder / js-curriculum.md
Created January 30, 2018 10:57
js-curriculum
  1. Intro to JavaScript

  • Similarities and differences from other languages
  • Useful resources for reference and help
  • Working within the browser (Firefox + Plugins)
  • Working with Aptana IDE
  • Code sharing
@azder
azder / short.js
Created October 12, 2017 10:17
read variable from cli and output it
console.log(process.argv[2]);
@azder
azder / matrix.html
Created May 13, 2017 21:10
_The Matrix_ style canvas animation
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Matrix</title>
</head>
<body style="margin:0;padding:0;overflow:hidden">
<canvas id="matrix" width="1280" height="800">
<script>
((canvas, screen, raf) => {

Keybase proof

I hereby claim:

  • I am azder on github.
  • I am azder (https://keybase.io/azder) on keybase.
  • I have a public key ASCoahvTHIsFKnB1FZQSAt7ybf0TrdCYB5aUHec3NX5FBAo

To claim this, I am signing this object: