Skip to content

Instantly share code, notes, and snippets.

@musou1500
musou1500 / example.txt
Last active July 16, 2016 08:51
spritesheet packer( https://spritesheetpacker.codeplex.com ) が吐き出すテキストの処理
0 = 0 0 160 160
1 = 163 0 160 160
10 = 326 0 160 160
11 = 0 163 160 160
12 = 163 163 160 160
13 = 0 326 160 160
14 = 163 326 160 160
15 = 326 163 160 160
16 = 326 326 160 160
17 = 489 0 160 160
@musou1500
musou1500 / decide_meshi.php
Created September 23, 2016 06:51
今日の飯を決めるPHPワンライナー.twitterでpaiza_runにでも投げましょう.
<?php var_dump(array_rand(array_flip(["与七","ゆーみー","むなし","天一","麦笑", "長次郎"])));
#!/usr/bin/env zsh
cat << 'EOT' > $HOME/.zshenv
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
EOT
. $HOME/.zshenv
unbind C-p
set-option -g default-shell /bin/zsh
# キーストロークのディレイを減らす
set -sg escape-time 1
# | でペインを縦に分割する
bind | split-window -h
@musou1500
musou1500 / test.js
Last active February 19, 2017 19:52
// ==UserScript==
// @name Test
// @namespace https://github.com/musou1500/
// @description テスト
// @match *://www.nicovideo.jp/*
// @match *://ext.nicovideo.jp/
// @match *://ext.nicovideo.jp/#*
// @match *://blog.nicovideo.jp/*
// @match *://ch.nicovideo.jp/*
// @match *://com.nicovideo.jp/*
sudo apt-get install \
libxml2 \
libxml2-dev \
libssl-dev \
pkg-config \
curl \
libcurl4-nss-dev \
enchant \
libenchant-dev \
libjpeg8 \
@musou1500
musou1500 / 10-trackpoint.rules
Created June 12, 2017 07:47
トラックポイントの速さと敏感さを上げるudev rule
DEVPATH=="/devices/platform/i8042/serio1/serio2", ATTR{sensitivity}="220", ATTR{speed}="200"
@musou1500
musou1500 / うんち.js
Created September 4, 2017 17:12
今日のうんちは何かな? https://shindanmaker.com/518611
const crypto = require('crypto');
const cheerio = require('cheerio');
const fetch = require('node-fetch');
const FormData = require('form-data');
function fetchUntilMatch(postInterval = 500) {
const input = crypto.randomBytes(8).toString('hex');
fetchResult(input)
.then(result => {
console.log(`${input} => ${result}`);
@musou1500
musou1500 / lzw.js
Last active January 23, 2018 11:01
LZW圧縮
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.on('line', (input) => {
const findFirstUnregisteredIndex = (input, dict) =>
input
@musou1500
musou1500 / youtube-capture-bookmarklet.js
Last active October 30, 2018 10:24
YouTubeの動画エリアをキャプチャして,pngファイルとして保存するブックマークレット
(() => {
const parseQueryString = (queryString) => {
const params = {};
queryString
.split('&')
.forEach((str) => {
const [k, v] = str.split('=');
params[k] = decodeURIComponent(v);
});
return params;