Skip to content

Instantly share code, notes, and snippets.

View taskie's full-sized avatar
🐌
𝑩𝑳𝑨𝒁𝑰𝑵𝑮 𝑭𝑨𝑺𝑻

taskie taskie

🐌
𝑩𝑳𝑨𝒁𝑰𝑵𝑮 𝑭𝑨𝑺𝑻
View GitHub Profile
@taskie
taskie / abcde.conf.sh
Created February 27, 2017 12:04
my abcde.conf
# ref.) http://www.andrews-corner.org/abcde.html
ACTIONS=cddb,playlist,read,encode,tag,move,clean
# cddb
CDDBURL="http://freedbtest.dyndns.org/~cddb/cddb.cgi"
CDDBCOPYLOCAL="y"
CDDBLOCALDIR="/data/media/abcde/cddb"
CDDBLOCALRECURSIVE="y"
CDDBUSELOCAL="y"
@taskie
taskie / PukiWiki.hs
Last active February 14, 2017 11:56
PukiWiki Reader for Pandoc(雑)
{-# LANGUAGE RelaxedPolyRec, FlexibleInstances, TypeSynonymInstances #-}
-- RelaxedPolyRec needed for inlinesBetween on GHC < 7
{-
Copyright (C) 2012-2015 John MacFarlane <[email protected]>
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 2 of the License, or
(at your option) any later version.
@taskie
taskie / get_raw_bytes.rs
Created January 24, 2017 13:16
Rust でメモリ上の生のバイト列を見るやつ
fn get_raw_bytes<T>(p: *const T) -> Vec<u8> {
// https://www.reddit.com/r/rust/comments/2ngnmk/viewing_any_object_as_a_raw_memory_array/
let size = std::mem::size_of::<T>();
let mut buf = Vec::with_capacity(size);
let view = p as *const _ as *const u8;
for i in 0..size {
buf.push(unsafe {*view.offset(i as isize)});
}
buf
}
@taskie
taskie / solarized.py
Last active October 14, 2016 09:41
Tiny Converter for Solarized Color Scheme
#!/usr/bin/env python3
#SOLARIZED HEX 16/8 TERMCOL XTERM/HEX L*A*B RGB HSB
#--------- ------- ---- ------- ----------- ---------- ----------- -----------
solstr = """
base03 #002b36 8/4 brblack 234 #1c1c1c 15 -12 -12 0 43 54 193 100 21
base02 #073642 0/4 black 235 #262626 20 -12 -12 7 54 66 192 90 26
base01 #586e75 10/7 brgreen 240 #585858 45 -07 -07 88 110 117 194 25 46
base00 #657b83 11/7 bryellow 241 #626262 50 -07 -07 101 123 131 195 23 51
base0 #839496 12/6 brblue 244 #808080 60 -06 -03 131 148 150 186 13 59
@taskie
taskie / pbc.pde
Last active April 12, 2016 13:51
P. B. C. (UTMC 2016年度初心者向けプログラミング講習会サンプルコード/シンプルな避けゲー 魔改造例)
//P. B. C. (Periodic Boundary Condition) by taskie
//derived from simple yoke-game sample by MASA
//color scheme: http://ethanschoonover.com/solarized
float boxW, boxH, boxX, boxY;
float bulletX[], bulletY[];//bullet position (x, y)
float bulletVx[], bulletVy[];//bullet velocity (x, y)
boolean isMyBullet[];
float bulletR = 5;//bullet radius
@taskie
taskie / genwebfonts.py
Created March 28, 2016 09:28
fontforge script to generate subsets of fonts
#!/usr/bin/env fontforge -lang=py -script
# -*- coding: utf-8 -*-
import fontforge
import sys
import os
def _select_codepoint(codepoint, selection, more=True):
more_str = 'more' if more else 'less'
if isinstance(codepoint, tuple) and len(codepoint) == 2:
# How to install Arch Linux
# ref.) https://wiki.archlinuxjp.org/index.php/%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%82%AC%E3%82%A4%E3%83%89
# ref.) http://qiita.com/macchaberrycream/items/1dfabe8b710dc638e3f9
# (boot from install CD)
loadkeys jp106
EDITOR=vi
# partition
@taskie
taskie / fonts.conf
Last active February 7, 2016 15:47
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<!-- fallback -->
<match target="pattern">
<test name="family" compare="not_eq" qual="all">
<string>sans-serif</string>
</test>
<test name="family" compare="not_eq" qual="all">
<string>serif</string>
#!/bin/bash
status () {
cd .vnc
local pidfile=$(hostname):1.pid
if [[ -f $pidfile ]]; then
local pid=$(cat $pidfile)
echo PID: $pid
if kill -0 $pid; then
echo "running"
#!/usr/bin/env ruby
devices = `xcrun simctl list devices`.each_line do |line|
if line =~ /[^\(]+\(([^\)]+)\)/
puts $1
`xcrun simctl delete #{$1}`
end
end