Skip to content

Instantly share code, notes, and snippets.

Avatar
🐛
Squashing bugs but sparing the cute ones!

Noah Doersing doersino

🐛
Squashing bugs but sparing the cute ones!
View GitHub Profile
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 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;
}
@doersino
doersino / markdeep-preview.html
Last active Nov 20, 2019
Preview Markdeep as you're typing (very simple, unstyled proof of concept)
View markdeep-preview.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style>
#markdeep_input {
height: 600px;
font-family: monospace;
}
td {
@doersino
doersino / backup_tumblr.sh
Last active Oct 28, 2017
Simple way of backing up one or multiple Tumblr blogs to date-prefixed folders; downloads and removes required software (except Python) automatically. http://neondust.tumblr.com/post/97723922505/simple-tumblr-backup-script-for-mac-os-x-and-linux
View backup_tumblr.sh
#!/bin/bash
# http://neondust.tumblr.com/post/97723922505/simple-tumblr-backup-script-for-mac-os-x-and-linux
# https://gist.github.com/doersino/7e3e5db591e42bf543e1
# BLOGS is a space-separated list of the blogs you want to backup. You can omit
# the ".tumblr.com" part if you want.
BLOGS="neondust.tumblr.com aufgeloest.tumblr.com hejlisten.tumblr.com"
# OUT is the directory where the backups will be stored. For each blog, a date-
# prefixed subdirectory will be created here.
@doersino
doersino / read_computeerts.php
Last active Sep 21, 2016
Upgrade script from ReAD commit f5bd3f4 to ad87e7b. See https://github.com/doersino/ReAD.
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
@doersino
doersino / read-get-titles.php
Last active Sep 8, 2016
Will attempt to (re-)get titles and sources for all articles in ReAD where the title is empty.
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` = ''");
@doersino
doersino / dotp.s
Last active Jul 6, 2016 — forked from tvh/dotp.s
This fork works with llvm-general-3.4.6.0.
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
@doersino
doersino / settitle.sh
Created Jan 26, 2013
Sets the window/tab title on an OS X terminal.
View settitle.sh
function settitle() {
local USAGE
USAGE="usage: settitle WINDOW_TITLE"
if [ -z "$1" ]; then
echo -e "$USAGE"; return 1
fi
echo -ne "\033]0;$1\007"
}
You can’t perform that action at this time.