Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
fetch_list() {
mkdir -p "$1"
youtube-dl -f 137+141/137+251/best -o "$1/%(title)s.%(ext)s" "$2"
}
fetch_list "Anatomy & Physiology" "https://www.youtube.com/playlist?list=PL8dPuuaLjXtOAKed_MxxWBNaPno5h3Zs8"
fetch_list "Astronomy" "https://www.youtube.com/playlist?list=PL8dPuuaLjXtPAJr1ysd5yGIyiSFuh0mIL"
fetch_list "Big History" "https://www.youtube.com/playlist?list=PL8dPuuaLjXtMczXZUmjb3mZSU1Roxnrey"
@dsprenkels
dsprenkels / nat.sh
Created November 3, 2017 09:53 — forked from mrngm/nat.sh
#!/bin/bash
function print_help() {
echo "Easy 4-step NAT tool"
echo "Usage: $0 internal-dev external-dev ip-range"
echo ""
echo "internal-dev e.g. eth0"
echo "external-dev e.g. wlan0"
echo "ip-range e.g. 192.168.0.1/24"
}
#!/usr/bin/env sage
# *-* encoding: utf-8 *-*
"""
Find a value `b` for the curve `E : y^2 = x^3 - 3x + b` s.t.
the curve has a prime order and its twist also has a prime order.
"""
from itertools import chain, count
00:29:15 [daan:~/Documents/Code/redox] master(+0/-0,1)* 1h14m28s ± make update all
cd cookbook; \
./update.sh "$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages ../initfs.toml ../filesystem.toml)"
Compiling either v1.1.0
Compiling matches v0.1.6
Compiling unicode-width v0.1.4
Compiling version-compare v0.0.4
Compiling extra v0.1.0 (https://github.com/redox-os/libextra.git#40293208)
Compiling libc v0.2.29
Compiling untrusted v0.5.0
#!/usr/bin/env python3
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
def set_axes():
axes = plt.gca()
axes.set_xlim([-0.25,6.25])
axes.set_ylim([0,50])
@dsprenkels
dsprenkels / reading_time.rb
Created June 21, 2017 12:57
A reading time filter for Jekyll templates
# A reading time filter for Jekyll templates
#
# Author: Daan Sprenkels <hello@dsprenkels.com>
#
# This module implements a filter for post content which calculates a range of
# time to display to the user. The filter is made for English text (and will
# display an English message). However, you can modify this script for your
# personal needs.
/*
* Arithmetic modulo 2^221 - 3 in radix 2^16 (unsigned)
*
* Authors:
* - Daan Sprenkels <hello@dsprenkels.com>
* - Jordi Riemens <jordi.riemens@student.ru.nl>
*
* This module uses redundant representation. Each number is represented an
* array of 14 int64_t elements.
*/
function cdroot()
{
cd .
}
alias prev='cd ../"$(ls -F .. | grep '/' | grep -B1 -xF "${PWD##*/}/" | head -n 1)"'
alias next='cd ../"$(ls -F .. | grep '/' | grep -A1 -xF "${PWD##*/}/" | tail -n 1)"'
function ne
{
#include "randombytes.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
const size_t size = 1024*1024;
char *buf;
size_t idx;
#/usr/bin/env bash
alias prev='cd ../"$(ls -F .. | grep '/' | grep -B1 -xF "${PWD##*/}/" | head -n 1)"'
alias next='cd ../"$(ls -F .. | grep '/' | grep -A1 -xF "${PWD##*/}/" | tail -n 1)"'
function cdroot() {
while [[ $PWD != '/' && ! $(basename $(dirname $(pwd))) =~ [A-Za-z0-9]+-Assignment_[0-9]+ ]]; do cd ..; done
}
function ne {