Personal wiki for imba progamming languare.
Basics
yes/no = true/false.
if status >= 200
return yes
// ==UserScript== | |
// @name Glastonbury helper | |
// @namespace http://tampermonkey.net/ | |
// @version 1.1 | |
// @description | |
// @author [email protected] | |
// @match https://www.happymeeple.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=happymeeple.com | |
// @grant none | |
// ==/UserScript== |
Personal wiki for imba progamming languare.
Basics
yes/no = true/false.
if status >= 200
return yes
My personal modifications for Karabiner
Reference: https://pqrs.org/osx/karabiner/json.html
{{! | |
Template for rendering .scss sprite file of svg sprite library (https://github.com/jkphl/svg-sprite). | |
Author: Panchenko Alexandr (github.com/panych) | |
source: https://gist.github.com/panych/b83287549f77535c08e8878a2c9e9e33 | |
This template: | |
1. Resolve issue with default padding model of svg-sprite library (https://github.com/jkphl/svg-sprite/issues/200). You have "real" margins | |
2. Uses px instead of % in background-position | |
3. Doesn't create ready to use classes, like `.icon-search`, but has mixin for that. |
class A { | |
constructor(msg) { | |
this.message = msg ? msg : 'default A message' | |
} | |
sayHello(additional) { | |
console.log(`${this.message}${additional ? ` and ${additional}` : ''}`) | |
} | |
} | |
class B { |
// Convert node to mithril fragment (mNode) | |
var DOMFragment = function(markup) { | |
if (markup.indexOf("<!doctype") > -1) return [new DOMParser().parseFromString(markup, "text/html").childNodes[1]] | |
var container = document.createElement("div"); | |
container.insertAdjacentHTML("beforeend", markup); | |
return container.childNodes; | |
} | |
var VirtualFragment = function recurse(domFragment) { |
function funnyURL(word, interval, prevID) { | |
prevID = prevID ? prevID : this.prevID; // assume that undefined is OK | |
clearInterval(prevID); | |
var i = 0, ID; | |
ID = setInterval(function() { | |
history.replaceState(null, '', word.slice(0,i+1)); | |
i = i+1; | |
if (i >= word.length) clearInterval(ID); | |
}, interval); |
http://olivierlacan.com/posts/launch-sublime-text-3-from-the-command-line/
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
Usage:
subl .
// 1. Variant. Use existing pane element. Can overlay map objects like placemark, ballons. | |
// https://tech.yandex.ru/maps/doc/jsapi/2.0/ref/reference/map.pane.Manager-docpage/ | |
map.panes.get('events').getElement().style.backgroundImage = 'my/background/image.png'; | |
// 2. Variant. Create custom element. Pros: set z-index. | |
var patternEl = document.createElement('div'); | |
patternEl.className = 'map__pattern'; | |
myMap.panes.getInnerElement().appendChild(patternEl); | |
// then you add styles like: | |
// .map__pattern { |
#!/usr/bin/python | |
""" | |
(https://snipt.net/raw/f8ef141069c3e7ac7e0134c6b58c25bf/?nice) | |
Save this file as server.py | |
>>> python server.py 0.0.0.0 8001 | |
serving on 0.0.0.0:8001 | |
or simply |