Skip to content

Instantly share code, notes, and snippets.

View Ultrabenosaurus's full-sized avatar

Dan Bennett Ultrabenosaurus

  • UK
View GitHub Profile
@robert-clayton
robert-clayton / standard_ebooks_opds_downloader.py
Last active September 2, 2019 18:15 — forked from Ultrabenosaurus/standard_ebooks_opds_downloader.py
Download all ebooks from the Standard eBooks OPDS catalogue, organised into subfolders by author and book title.
####
#
# 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.
@Ultrabenosaurus
Ultrabenosaurus / mp4-to-gif.sh
Last active October 4, 2021 13:42
Simple bash script to convert MP4 videos to GIF
#!/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
@AnalogJ
AnalogJ / download_opds.py
Created August 29, 2017 01:54
download all books in OPDS catalog.
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'):
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@TimBlock
TimBlock / 4.5
Created January 15, 2016 12:00
// 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){
@walkerstone
walkerstone / index.html
Created October 28, 2014 15:39
Single page template
<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.

@dan-bennett
dan-bennett / aliases.sh
Last active August 29, 2015 14:05
my shell aliases
#!/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
@shamil
shamil / mount_qcow2.md
Last active December 12, 2024 09:19
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
# yolo
<input type="text" autofocus>
</body>