- 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 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 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 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
# requires socksify gem | |
require "socksify" | |
require 'socksify/http' | |
# use w/ OAuth2 like OAuth2::Client.new(id, secret, connection_opts: { proxy: 'socks://127.0.0.1:9050' }) | |
class Faraday::Adapter::NetHttp | |
def net_http_class(env) | |
if proxy = env[:request][:proxy] | |
if proxy[:uri].scheme == 'socks' | |
Net::HTTP::SOCKSProxy(proxy[:uri].host, proxy[:uri].port) |
This file contains 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
wget "http://www.yad2.co.il/mailsecure.php" -O "captcha.jpg" && \ | |
convert -white-threshold 55% captcha.jpg clean_captcha.jpg && \ | |
tesseract clean_captcha.jpg captcha -psm 8 digits && \ | |
cat captcha.txt |
This file contains 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
HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew upgrade tmux | |
------------------------------------------------ | |
==> Upgrading 1 outdated package, with result: | |
tmux 1.8 | |
==> Upgrading tmux | |
rm /usr/local/bin/tmux | |
rm /usr/local/etc/bash_completion.d/tmux | |
rm /usr/local/share/man/man1/tmux.1 | |
==> Downloading http://sourceforge.net/projects/tmux/files/tmux/tmux-1.8/tmux-1.8.tar.gz |
This file contains 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 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 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 | |
} |
NewerOlder