Skip to content

Instantly share code, notes, and snippets.

@electronicbites
electronicbites / extract_youtube_id.js
Last active March 24, 2020 19:49
extract youtube id
function extractVideoID(url) {
let id = '';
url = url.replace(/(>|<)/gi,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/);
if ( url[2] !== undefined ) {
id = url[2].split(/[^0-9a-z_\-]/i)[0];
} else {
id = url;
}
return id;
https://www.highsnobiety.com/p/palace-drop-list/
https://www.highsnobiety.com/p/supreme-fw19-accessories/
https://www.highsnobiety.com/p/dave-chappelle-new-netflix-stand-up-special/
https://www.highsnobiety.com/p/apple-iphone-11-names/
https://www.highsnobiety.com/p/killer-mike-bill-maher-jay-z-nfl/
https://www.highsnobiety.com/p/supreme-fw19-hoodies/
https://www.highsnobiety.com/p/supreme-fw19-t-shirts/
https://www.highsnobiety.com/p/iphone-11-release-date/
https://www.highsnobiety.com/p/supreme-fw19-lookbook/
https://www.highsnobiety.com/p/noah-fw19/
@electronicbites
electronicbites / missing_urls.txt
Created January 3, 2019 15:40
not mapped urls
https://www.overkillshop.com/en/atmos-x-asics-gel-lyte-iii-1191a197-400.html
https://www.xn--rgreen-kbh-zcb.dk/product/tamok-3/
https://www.mrporter.com/en-us/mens/oakley/o-frame-2-0-xm-snow-goggles/1076903?ppv=2#
https://www.mrporter.com/en-us/mens/oakley/o-frame-2-0-xl-snow-goggles/1076901?ppv=2#
http://yun-berlin.com/default/yardan-grey-silver.html
https://www.mrporter.com/en-us/mens/anon/mig-ski-goggles-and-stretch-jersey-face-mask/1075530?ppv=2#
https://www.mrporter.com/en-us/mens/poc/lid-clarity-ski-goggles/1076867?ppv=2#
https://www.mrporter.com/en-us/mens/poc/fovea-clarity-ski-goggles/1076860?ppv=2#
https://www.mrporter.com/en-us/mens/oakley/flight-deck-xm-rimless-prizm-ski-goggles/1076893?ppv=2#
https://www.oakley.com/en/men/sunglasses/jawbreaker/product/W0OO9290/?skuCode=OO9290-2031&variant=888392243645&categoryCode=101000000m
_ Shift + - Underscore
[ ALT + 5
] ALT + 6
{ ALT + 8 Curly Braces
} ALT + 9
~ ALT + n Tilde
' Shift + # Single Quote
a = [1, 2, 3]
a = Array.new([1, 2, 3])
ary = Array.new
Array.new(3)
Array.new(3, true)
a[0]
a.size
a << 23
class Animal
def speak
puts "?"
end
end
class Cat < Animal
def speak
puts "miau"
end
# debugging feature specs with webit driver
save_and_open_screenshot
page.driver.console_messages
page.driver.error_messages
➜ retailer-scrapers git:(master) ✗ shub deploy 146870
Packing version fe3f096-master
Deploying to Scrapy Cloud project "146870"
Deploy log last 30 lines:
_get_apisettings, commands_module='sh_scrapy.commands')
File "/usr/local/lib/python2.7/site-packages/sh_scrapy/crawl.py", line 148, in _run_usercode
_run(args, settings)
File "/usr/local/lib/python2.7/site-packages/sh_scrapy/crawl.py", line 103, in _run
_run_scrapy(args, settings)
File "/usr/local/lib/python2.7/site-packages/sh_scrapy/crawl.py", line 111, in _run_scrapy
export default Controller.extend({
actions: {
incrementPage() {
let page = this.get('page');
let max = this.get('products.meta.total_pages');
if (page < max) {
this.set('page', page + 1);
}
},
decrementPage() {
r = Restaurant.find ‘coda'
#di-do
st_bar = ShiftTemplate.find(261)
st_dinner = ShiftTemplate.find(236)
st_dinner.end_time = st_bar.end_time
st_dinner.save
st_dinner.reset_shifts
## ??? reset did not work as expected (end_time anpassen)