Skip to content

Instantly share code, notes, and snippets.

View creaktive's full-sized avatar
👽
🛸

Stanislaw Pusep creaktive

👽
🛸
View GitHub Profile
@creaktive
creaktive / Aggregated-GitHub-traffic-stats.sh
Created November 30, 2022 16:28
Aggregated GitHub traffic stats
gh repo list --limit 999 --no-archived --visibility public --json nameWithOwner --jq '.[] | .nameWithOwner' |\
PAGER= xargs -I% gh api repos/%/traffic/views --jq 'select(.count != 0) | [.count, .uniques, "https://github.com/%"] | join("\t")' |\
sort -nrk2
{
"id": 1,
"jsonrpc": "2.0",
"result": [
{
"id": "Condition",
"index": 0,
"name": "Condition",
"normalized_value": 0,
"text": "0",
@creaktive
creaktive / keybindings.json
Created May 6, 2022 09:18
VSCode fix for Alt+. in Terminal
[
{
"key": "alt+.",
"command": "workbench.action.terminal.sendSequence",
"args": { "text": "\u001b." }
}
]
@creaktive
creaktive / benchmark.cpp
Created April 1, 2022 10:12
pianolizer benchmark
/*
* wget https://github.com/creaktive/pianolizer/raw/master/cpp/pianolizer.hpp
* g++ -Ofast -std=c++14 -o benchmark benchmark.cpp
*/
#include <chrono>
#include <iostream>
#include <stdlib.h>
#include "pianolizer.hpp"
@creaktive
creaktive / mandelbrot.frag
Created March 25, 2021 15:18
Mandelbrot set plot, implemented as GLSL fragment shader
// shamelessly stolen from https://p5js.org/reference/#/p5/loadShader
// ported to work with https://thebookofshaders.com/edit.php
precision highp float;
const int I = 500;
void main() {
vec2 vPos = gl_FragCoord.xy;
vec2 p = vec2(-0.74364388703, 0.13182590421);
float r = .00001;
vec2 c = p + vPos * r, z = c;
float n = 0.0;
find ~/.local/share/Modartt/Pianoteq/Archive/ -type f -name \*.mid | sort | perl -MYAML::XS -nE 'if ( m{(\d{4}-\d{2}-\d{2}).+?(\d+)\s+notes,\s+(\d+)\s+seconds} ) { $s{$1}{notes} += $2; $s{$1}{minutes} += $3 / 60 } else { die } }{ say Dump \%s'
@creaktive
creaktive / gist:936dc156bd8df3ddf0c25bd7a19943be
Created June 17, 2020 17:17
was any of my 100 recent git commits reverted?
git log -P --grep "This reverts commit ($( git log --author=$USER --format=%H | head -n 100 | paste '-sd|' ))"
@creaktive
creaktive / recent.sh
Created March 12, 2020 16:33
psyndora recent tracks CLI
curl -q -s 'https://cast.magicstreams.gr:2199/external/rpc.php?m=recenttracks.get&username=psyndora&charset=&mountpoint=&rid=psyndora&limit=10' | \
jq -c '.data[0][] | [.localtime, .artist, .album, .title]'
@creaktive
creaktive / cli-vj.sh
Last active October 13, 2019 11:33
CLI VJ
# requirements: curl, ffmpeg, youtube-dl
mkdir ttaass.com
chdir ttaass.com
curl https://www.ttaass.com |\
perl -nE 'say $1 while m{"(http://www\.youtube\.com[^"]+)}g' |\
sort -u |\
xargs -n 1 youtube-dl -f 'bestvideo[ext=mp4,width=1920,height=1080]'
# delete the unwanted ones...
@creaktive
creaktive / hilbert-curve.pl
Created December 31, 2018 07:51
Recursive Hilbert Curve generator
#!/usr/bin/env perl
# http://www.fundza.com/algorithmic/space_filling/hilbert/basics/
# http://www.soc.napier.ac.uk/~andrew/hilbert.html
use strict;
use warnings;
sub hilbert {
my ($n, $x, $y, $xi, $xj, $yi, $yj, $mn) = (@_, qw(0 0 1) x 2, $_[0]);
return !$n
? [