The original article can be found here
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/perl | |
# i wouldn't recommend using this in its current state. because it uses sndioctl instead | |
# of using libsndio directly, there's pretty much no way to detect server restarts &c. | |
# this will be rewritten as a small C program soon. | |
# this is intended to be run as a per-user service | |
# https://docs.voidlinux.org/config/services/user-services.html | |
use strict; |
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
import numpy as np | |
from random import uniform | |
from scipy.signal import square | |
from scipy.io import wavfile | |
samplerate = 44100 | |
startlength = 8 | |
chirplength = 4 | |
endlength = 16 |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Line Art</title> | |
</head> | |
<body> | |
<canvas id="c"></canvas><br> | |
<label for="r">Radius</label> |
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
/* | |
emojify.js 1.0.0 | |
by robbie0630 | |
Description: | |
converts text into Discord-compatible emojis | |
PLANNED FEATURES: | |
* needs more ES2015 | |
* needs more ES2016 |
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
fetch(window.location.href).then(res => | |
res.text().then(text => { | |
let domParser = new DOMParser() | |
let newDoc = domParser.parseFromString(text, res.headers.get('Content-Type').split(';')[0]) | |
let newNode = document.importNode(newDoc.documentElement, true) | |
document.replaceChild(newNode, document.documentElement) | |
}) | |
) |
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
base = 10 | |
def radixsort(list): | |
maxPlace = max(len(int2base(i, base)) for i in list) | |
list = [(0, i) for i in list] | |
for i in range(1, maxPlace + 1): | |
list = [(FindInPlace(j, base, i), j) for _, j in list] | |
newList = [] | |
for j in range(base): | |
newList += [k for k in list if k[0] == j] |
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
from math import floor | |
def shellsort(list): | |
gaps = gengaps(len(list)) | |
for gap in gaps: | |
for i in range(gap, len(list)): | |
temp = list[i] | |
j = i | |
while j >= gap and list[j-gap] > temp: | |
list[j] = list[j - gap] |
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
from heapq import heapify, heappop #is this cheating? | |
def heapsort(list): | |
heap = heapify(list) | |
newList = [] | |
while heap: | |
newList.append(heappop(heap)) | |
return newList | |
if __name__ == '__main__': | |
from sys import argv |
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
if __name__ == '__main__': | |
from sys import argv | |
from random import shuffle | |
list = list(range(int(argv[1]))) | |
list.sort() # ;) | |
print(all(list[i] <= list[i+1] for i in range(len(list)-1))) | |
# seriously though timsort is really weird |
NewerOlder