Skip to content

Instantly share code, notes, and snippets.

View redbrain's full-sized avatar
:shipit:

redbrain redbrain

:shipit:
View GitHub Profile
@redbrain
redbrain / helloworld.js
Created July 22, 2022 22:33
A working JS Hello World program (in browser or Node)
[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+(+(!+[]+!+[]+!+[]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(!
@redbrain
redbrain / An overview of youtube-dl and ytdl-core.md
Last active October 21, 2021 19:08
A tutorial for getting acquainted with YouTube-downloading libraries

youtube-dl and ytdl-core

This is a short guide aimed at beginners to explain what youtube-dl and ytdl-core are and how to use them effectively.


Preface: are you a programmer?

youtube-dl and ytdl-core are not user-friendly websites or GUI applications for downloading YouTube videos!
The projects are meant for embedding in computer programs.
If you're looking for a YouTube downloading website, check out

@redbrain
redbrain / snek.html
Created November 8, 2020 03:27
A minified and heavily corrected version of my first game
<!DOCTYPE html><html><head><style>#g{background:black;margin:auto;display:block;}</style></head><body><canvas id="g" width="640px" height="480px"></canvas></body><script>const area_w=640,area_h=480,tile_sz=32,area_tile_w=area_w/tile_sz,area_tile_h=area_h/tile_sz,padding=tile_sz/4,food_padding=tile_sz/8,max_snake=area_tile_w*area_tile_h,D_UP=38,D_DOWN=40,D_LEFT=37,D_RIGHT=39;var canvas=document.getElementById("g"),ctx=canvas.getContext("2d"),phys_timer=null,dir=0,started=!1,pos=[{x:Math.round(area_tile_w/2),y:Math.round(area_tile_h/2)}],food=null,ctrl_stack=[],forgive=!1;function pos_equal(e,a){return e.x==a.x&&e.y==a.y}function place_food(){var e;do{food={x:Math.floor(Math.random()*area_tile_w),y:Math.floor(Math.random()*area_tile_h)},e=!1;for(var a=0;a<pos.length;a++)if(pos_equal(pos[a],food)){e=!0;break}}while(e)}function draw_internal(){if(ctx.clearRect(0,0,area_w,area_h),ctx.fillStyle="white",pos.length>1)for(var e=1;e<pos.length;e++){var a=pos[e],t=pos[e-1],i=Math.min(a.x,t.x),_=Math.max(a.x,t.x),o=Math.
@redbrain
redbrain / thinkpython.tex
Created October 20, 2020 19:12
Think Python (the texbook) as a LaTeX file. Directly from the repo AllenDowney/ThinkPython, but I needed it as a gist.
% LaTeX source for ``Think Python: How to Think Like a Computer Scientist''
% Copyright (c) 2012 Allen B. Downey.
% License: Creative Commons Attribution-NonCommercial 3.0 Unported License.
% http://creativecommons.org/licenses/by-nc/3.0/
%
%\documentclass[10pt,b5paper]{book}
\documentclass[10pt]{book}
\usepackage[width=5.5in,height=8.5in,