Skip to content

Instantly share code, notes, and snippets.

View MetroWind's full-sized avatar
🐱
Setting status…

Metro Wind MetroWind

🐱
Setting status…
View GitHub Profile
@MetroWind
MetroWind / circle.rs
Created January 8, 2020 03:23
Draw a circle with Rust
extern crate sdl2;
use std::path::Path;
use std::time::Duration;
use sdl2::render::Canvas;
use sdl2::video::Window;
use sdl2::event::Event;
use sdl2::keyboard::Keycode;
use sdl2::rect::{Point, Rect};
@MetroWind
MetroWind / mw96.json
Last active July 26, 2020 23:05
Keymap for my XD96 build
{
"version": 1,
"notes": "My awesome keymap",
"documentation": "\"This file is a QMK Configurator export. You can import this at <https://config.qmk.fm>. It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: <https://docs.qmk.fm/#/newbs>\n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n",
"keyboard": "xd96",
"keymap": "mw96",
"layout": "LAYOUT_96_ansi",
"layers": [
[
"KC_ESC",
@MetroWind
MetroWind / cover.asy
Created November 4, 2019 04:08
Cover for statistical mechanics
unitsize(2mm);
srand(101);
real Width = 100.0;
real Height = 133.04;
real ColorOffset = 0.3;
path BBox = (0,0)--(Width, 0)--(Width, Height)--(0, Height)--cycle;
path BAR = scale(0.1*Width, 0.7*Width) * shift(-0.5, -0.5) * unitsquare;
@MetroWind
MetroWind / list-games.py
Created September 30, 2019 22:03
Scrap the game list JSON from Steam profile page.
#!/usr/bin/env python3
import sys, os
import json
import time
from tqdm import tqdm
import requests
import lxml.html
@MetroWind
MetroWind / perspective.html
Created August 8, 2019 22:30
CSS Perspective
<!doctype html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<style>
:root
{
--distance: 600px;
--angle: 30deg;
@MetroWind
MetroWind / plot.py
Created June 19, 2019 18:44
3D scatter plot
#!/usr/bin/env python
import sys, os
import numpy
import matplotlib
import matplotlib.font_manager as Fm
import matplotlib.backends.backend_pdf as PltPDF
from mpl_toolkits.mplot3d import Axes3D
def loadData(filename):
@MetroWind
MetroWind / style.css
Created June 17, 2019 22:58
DuckDuckGo multi-column
.results
{
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-around;
}
.result
{
@MetroWind
MetroWind / Launch
Created December 25, 2017 20:26
KSP kOS launch script
CLEARSCREEN.
//This is our countdown loop, which cycles from 10 to 0
PRINT "Counting down:".
FROM {local countdown is 10.} UNTIL countdown = 0 STEP {SET countdown to countdown - 1.} DO
{
PRINT "..." + countdown.
WAIT 1. // pauses the script here for 1 second.
}
@MetroWind
MetroWind / .emacs.el
Last active October 13, 2017 00:13
Maximize/restore Emacs window.
;; Maximize and restore window.
(defvar window-confs (make-hash-table))
;; window-confs is equvalent to this:
;;
;; { frame1: {"zoomed": false, "conf": <some conf>},
;; frame2: {"zoomed": true, "conf": <some other conf>} }
(defun save-window-conf ()
"Save current window configuration of current frame."
(let ((this-frame (selected-frame))
@MetroWind
MetroWind / geekhack.css
Created July 11, 2017 21:20
Geekhack eye protector
body
{
font-family: "Avenir Next", sans-serif;
}
div#wrapper
{
max-width: 1024px;
}