View generative-art-with-markdeep-diagrams.js
// Generative art with Markdeep diagrams. | |
// | |
// Examples: https://twitter.com/doersino/status/1321191553403129857 | |
// Markdeep: https://casual-effects.com/markdeep/features.md.html#basicformatting/diagrams | |
// | |
// Usage: | |
// 1. Navigate to: https://doersino.github.io/markdeep-diagram-drafting-board/ | |
// 2. Open the JavaScript console (if you need help, see https://webmasters.stackexchange.com/a/77337). | |
// 3. Paste the contents of this file and press Enter. | |
// 4. Type "art()" and press Enter. |
View markdeep-preview.html
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<style> | |
#markdeep_input { | |
height: 600px; | |
font-family: monospace; | |
} | |
td { |
View inttostr.c
#include <math.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
char *inttostr_conventional(int n) { | |
char *s = (char*) malloc(sizeof(char) * 42); | |
sprintf(s, "%d", n); | |
return s; | |
} |
View read_computeerts.php
<?php | |
error_reporting(E_ALL); | |
require_once "deps/meekrodb.2.3.class.php"; | |
require_once "TextExtractor.class.php"; | |
$allArticles = DB::query("SELECT * FROM `read` ORDER BY `time_added` ASC"); | |
$N = count($allArticles); |
View sx2.m
% 1. download files from http://alumni.soe.ucsc.edu/%7Exzhu/doc/turbulence.html to current folder | |
% | |
% 2. run | |
% $ youtube-dl -o sx.mp4 https://www.youtube.com/watch?v=_BgJEXQkjNQ | |
% to download the video and | |
% $ ffmpeg -ss 00:00:50 -i sx.mp4 -filter:v fps=fps=60/1 frames/ffmpeg_%3d.png | |
% to extract the frames - quit this once it reaches frame 1310 or so | |
% | |
% 3. then run this script (might take a few days) | |
% |
View sx.m
% 1. download files from http://alumni.soe.ucsc.edu/%7Exzhu/doc/turbulence.html to current folder | |
% and http://tmp.hejnoah.com/frames_Sothh.zip to subfolder "frames_Sothh" | |
% | |
% 2. run | |
% $ youtube-dl -o sx.mp4 https://www.youtube.com/watch?v=_BgJEXQkjNQ | |
% to download the video and | |
% $ ffmpeg -ss 00:01:05 -i sx.mp4 -filter:v fps=fps=60/1 frames/ffmpeg_%3d.png | |
% to extract the frames - quit this once it reaches frame 450 or so | |
% | |
% 3. then run this script |
View read-get-titles.php
<?php | |
// Put this in the same folder as your https://github.com/doersino/ReAD install. | |
// This will attempt to (re-)get titles and sources for all articles where the | |
// title is empty. | |
require_once "lib/meekrodb.2.3.class.php"; | |
require_once "Helper.class.php"; | |
$q = DB::query("SELECT * FROM `read` WHERE `title` = ''"); |
View dotp.s
; ModuleID = 'dotp.c' | |
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" | |
target triple = "x86_64-unknown-linux-gnu" | |
; Function Attrs: nounwind readonly uwtable | |
define float @dotp(float* nocapture %a, float* nocapture %b, i32 %count) #0 { | |
%1 = icmp sgt i32 %count, 0 | |
br i1 %1, label %.lr.ph, label %._crit_edge | |
.lr.ph: ; preds = %0, %.lr.ph |
View backup_uberspace.sh
#!/bin/bash | |
# This script creates a backup of your Uberspace home folder, as well as your | |
# websites and MySQL databases. Configure username and server before running. | |
# | |
# TODO ^C should quit this entire script and clean up first (remove db backup) | |
# TODO some error handling and exit codes | |
# TODO set username and server via flags | |
# TODO sanity checking before backup: "these server contents get copied to this local folder" |
View imagesnap_avoidmemoryleak.sh
#!/bin/bash | |
# Avoids the memory leak occuring when capturing many webcam pictures using | |
# imagesnap version 0.2.5 by regularly restarting the command. | |
# | |
# As a result, the interval between successive pictures is not always exactly as | |
# specified in $IMAGESNAP_CONFIG. To get as close to it as possible, set | |
# $RESTART_INTERVAL to some multiple of the -t interval. | |
# By default, imagesnap is configured to wait 1s before taking the first | |
# picture: without this delay, the first picture tends to be underexposed. |
NewerOlder