Skip to content

Instantly share code, notes, and snippets.

View iamevn's full-sized avatar

Evan Minsk iamevn

View GitHub Profile
### Keybase proof
I hereby claim:
* I am iamevn on github.
* I am iamevn (https://keybase.io/iamevn) on keybase.
* I have a public key whose fingerprint is 889A 0993 E9AE CA50 EE56 C506 8394 F8A4 8E0D 01DB
To claim this, I am signing this object:
@iamevn
iamevn / simple-paint.c
Last active August 29, 2015 14:27
playing around with 3DS, next step is to add 3D LAYERS. build at https://d.maxfile.ro/uthptfzswu.3dsx
#include <string.h>
#include <stdio.h>
#include <stdbool.h>
#include <3ds.h>
// given buffer, its width and height, real coords, and rgb values
// draw corresponding pixel as given rgb color
// doesn't draw pixel if (x, y) is outside box bounded by (0, 0) (w-1, h-1) rect
bool setPixel(u8 *fb, u16 w, u16 h, u16 r_x, u16 r_y, u8 r, u8 g, u8 b) {
@iamevn
iamevn / notepad_hijack_framework.cpp
Created August 23, 2015 05:23
framework for interacting with a notepad.exe window
#include <windows.h>
#include <deque>
#define VKEY_LEFT 37
#define VKEY_UP 38
#define VKEY_RIGHT 39
#define VKEY_DOWN 40
#define VKEY_Q 81
#define VKEY_START 69
script_name="Clip Transform Points"
script_description="first and last lines selected should have clips with the same number of points. transforms each point's position from first to last line over the selected lines (WARNING: wipes out any clip on intermediate lines"
script_author="iamevn"
script_version="0.1"
script_namespace="evn.ClipTransformPoints"
function transform(subs, sel)
--[[
@iamevn
iamevn / fuck confetti.py
Created May 11, 2016 18:31
copies lines to clipboard at end
#!/usr/bin/env python3
##let's generate some fucking confetti
import random
from math import ceil, floor
## genconfetti()
## args:
# line template
# - needs to be formatted with start time, end time, color, x position, y position, frz, and drawing coordinates in that order with these keys
# times
# - array of times
function extract_mkv_fonts
set -l BEFORE (ls | wc -l)
set -l COUNT 0
for FILE in $argv
set COUNT (math $COUNT + 1)
mkvextract attachments $FILE (mkvmerge -i $FILE | grep -o Attachment\ ID\ [0-9]\*: | grep -o [0-9]\*) 1> /dev/null
end
echo Extracted (math (ls | wc -l) - $BEFORE) fonts from $COUNT files
end
#lang racket
(require racket/gui)
(require racket/date)
(define current-time #(0 0 0)) ;#(h m s)
(define tau (* 2 pi))
(define time->str
(λ (t)
(~a (~r (vector-ref t 0) #:min-width 2 #:pad-string "0")
":"
@iamevn
iamevn / i3 config
Created August 3, 2016 22:58
my i3 config, mostly default
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#! /usr/bin/env python
# created by someone who needs to learn how python even works
# released March 2015 under the WTFPL version 2
# you're gonna need PyQt4, also this definitely works in python 3, no clue about 2
import sys, time, tempfile, base64
from PyQt4 import QtGui, QtCore, Qt
app = QtGui.QApplication(sys.argv)
label = QtGui.QLabel()
@iamevn
iamevn / backlight
Created September 2, 2016 05:56
i3blocks
#!/bin/sh
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of