- MouseEvent
which
property tells us which button was clicked (1 - left, 2 - middle, 3 - right). - Events in JS propagate outward only, is that true? Isn't there a inward propagation before that (like in good old Flash)?
- What's the difference between
stopPropagation
andstopImmediatePropagation
? - Is there a way to know if an event's default action was cancelled? Is there a way to un-cancel it?
- "keydown" event is trigerred everytime the key repeats itself.
- String.prototype.charCodeAt does what you think it does.
- Keybord Events have shiftKey, ctrlKey, altKey, and metaKey flags.
- "keypress" is fired after "keydown" but is only fired for keys that generate text-input.
- String.fromCharCode translates a code into a charcter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import os | |
import bisect | |
import collections | |
import collections.abc | |
import itertools | |
import math | |
import operator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run this script on a search page to get a list of large sellers (>1000) | |
// Use &_saslop=2&_sasl=<comma separated list to exclude sellers> | |
let sellerNameAndSalesMapper = (elem) => { | |
let sellerAndSalesText = elem.innerText.match(/Seller: ([-.\w]*) \(([\d,]*)\)/).slice(1) | |
return { seller: sellerAndSalesText[0], sales: parseInt(sellerAndSalesText[1].replace(',', ''), 10) } | |
} | |
let bigSellersFilter = (sellerAndSales) => { | |
const LARGE_SELLER_CAP = 1000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
Version: GnuPG v1 | |
mQINBFK3DOoBEADquhi1AuQFTlHn6RXO7ELZIQAVZAD7HuoGcyq+WhSU/Y5k17kX | |
rsXyxGKrWfE4rkICBPWPnOxolAYFAAfJKoh6hEO6cqip8tbWygJjH4VrjDRGyeXZ | |
jhQAKnzSte+QSmllprebx7CjFBMQJ4OFepo78Vjr9piGEfZZ9egu19ZsJBHlnS6J | |
aT+jaCO8dYErFIV7htK012f68DP0DHKmRj7NxQ5pqBbNY5aejWm7j0DoE6ckzxWC | |
GojsThXqJni6+oGuT/YkYELBuFDJLYOGG/yQGsqAZtfKl0paO8oZTqOk5B1Nt3Za | |
GbHDIjvSJAXYQO74lAxQV7fhcqr3c7mUB1X0d8OeU8Lb0/lmjxOe1JNyDZ1pd/k3 | |
izkIi2nWEy8RCb8tgw/+Vb84sN4dQkZdNMs2TkPzmZuXk49LJ6mWK6iHD59hQFFW |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $ egrep -oh "href=\"https?://((\w+).)?(youtube|soundcloud|vimeo|dailymotion|bandcamp).*?\"" export_sd_4ed12435bcfe756bf51992a7.html | grep -oh "http.*[^\"]" > RayV_list | |
http://youtube.com/watch?v=KMRACkJGW1Y | |
http://youtube.com/watch?v=clibKrEDBhU | |
http://youtube.com/watch?v=ZiOI2y5007k | |
https://yuvalsaartheveryveryband.bandcamp.com/track/blackbird | |
http://youtube.com/watch?v=WXLM865u5bM | |
http://youtube.com/watch?v=-zAHs6wrz64 | |
http://youtube.com/watch?v=kUvIdEWiQms | |
http://youtube.com/watch?v=Q5J0y-EbkII |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ydl-mp3 () { | |
youtube-dl -o "%(title)s.%(ext)s" --extract-audio --audio-format=mp3 $1 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<p style="text-align: center"> | |
<img src="http://eloquentjavascript.net/img/cat.png" style="position: absolute"> | |
<img src="http://eloquentjavascript.net/img/hat.png" style="position: absolute"> | |
</p> | |
<script> | |
var cat = document.querySelector("img[src*='cat']") | |
var hat = document.querySelector("img[src*='hat']") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mergesort :: (Ord a) => [a] -> [a] | |
mergesort [x] = [x] | |
mergesort xs = merge (mergesort (left xs)) (mergesort (right xs)) | |
where left xs = take ((length xs) `div` 2) xs | |
right xs = drop ((length xs) `div` 2) xs | |
merge :: (Ord a) => [a] -> [a] -> [a] | |
merge [] ys = ys | |
merge xs [] = xs | |
merge (x:xs) (y:ys) |
I hereby claim:
- I am almog on github.
- I am almog (https://keybase.io/almog) on keybase.
- I have a public key whose fingerprint is 773C DC54 43EC 3528 4219 B81B 3892 F02E AFC1 BD6F
To claim this, I am signing this object:
NewerOlder