Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
#### | |
# | |
# Download all of the Standard eBooks catalogue from their OPDS feed. | |
# | |
# https://standardebooks.org/ | |
# | |
# Modified to download all files for each book except the SVG cover and to | |
# organise the files in subfolders by Author > Book Title. | |
# The original script downloads only the EPUB file for each book into the | |
# working directory with no subfolders. |
#!/bin/bash | |
############################################# | |
# | |
# mp4-to-gif | |
# | |
# Convert MP4 videos to GIF images | |
# Requires ffmpeg and imagemagick | |
# | |
# -g and --gifsicle options create a second optimised GIF for your consideration |
import urllib2 | |
import os | |
import urllib, urlparse | |
import xml.etree.cElementTree as et | |
e = et.ElementTree(file=urllib2.urlopen('https://standardebooks.org/opds/all')).getroot() | |
print(e) | |
print("parsing") | |
for atype in e.iter('{http://www.w3.org/2005/Atom}link'): |
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
// Your code here. | |
function every(array,predicate){ | |
for(var i = 0; i<array.length; i++){ | |
if (!predicate(array[i])) | |
return false; | |
} | |
return true; | |
} | |
function some(array,predicate){ |
<html> | |
<head> | |
<style> | |
html { height: 101%; } | |
body { margin: 0; padding: 0; font-family: sans-serif;} | |
h1, h2, h3 { margin: 0; } | |
a { font-weight: ; text-decoration: none; color: #586FB2;} | |
.active { background: #586FB2; color: white;} |
ajax.x - The XMLHttpRequest object (or MS equivalent) used for communication
ajax.serialize(f) f = the form element you wish to be serialized This function serializes all the fields in a form so that they can be passed as a query string in the form 'arg1=val1&arg2=val2'.
ajax.get(url, func) url = the url to query (can contain arguments after a '?') func = the function to call once the response is returned This function uses a GET request to query the specified url and return a response to the specified function.
#!/bin/bash | |
# backup "<path>" | |
# create a new folder in the backups directory and dump the current directory's contents into it | |
backup(){ | |
mkdir "/path/to/backups/$1"; | |
cp -r . "/path/to/backups/$1"; | |
} | |
# bs |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
# yolo | |
<input type="text" autofocus> | |
</body> |