Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
for f in Ricty*.ttf; do
ttx -t OS/2 "${f}"
sed -i -e 's/xAvgCharWidth value="913"/xAvgCharWidth value="500"/' "${f%%.ttf}.ttx"
mv "${f}" "${f%%.ttf}.orig.ttf"
ttx -m "${f%%.ttf}.orig.ttf" "${f%%.ttf}.ttx"
rm "${f%%.ttf}.orig.ttf" *.ttx
done
--- ricty_generator_for_nerd_fonts.sh 2018-11-06 20:40:55.693412146 +0900
+++ ricty_generator_for_nerd_fonts.sh 2018-11-08 10:18:29.953438400 +0900
@@ -251,10 +251,10 @@
exit 1
fi
# Check filename
- [ "$(basename $input_inconsolata_regular)" != "Inconsolata-Regular.ttf" ] &&
+ [ "$(basename "${input_inconsolata_regular}")" != "Inconsolata-Regular.ttf" ] &&
echo "Warning: ${input_inconsolata_regular} does not seem to be Inconsolata Regular" >&2
- [ "$(basename $input_inconsolata_bold)" != "Inconsolata-Bold.ttf" ] &&
@shelaf
shelaf / SMBDIS.ASM
Created March 27, 2018 10:35 — forked from 1wErt3r/SMBDIS.ASM
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@shelaf
shelaf / gist:8d27012aa6a9623063f52336d9b4319c
Created January 6, 2018 02:17
TortoiseSVN/Git用差分・マージ設定
差分
WinMergeU.exe /e /ub /wl /wr /dl %bname /dr %yname "%base" "%mine%"
マージ
WinMergeU.exe /e /ub /wl /wr /dl %yname "%mine" /dm %mname "%merged" /dr %tname "%theirs"
#include <bits/stdc++.h>
#include <sys/time.h>
using namespace std;
#define rep(i,n) for(long long i = 0; i < (long long)(n); i++)
#define repi(i,a,b) for(long long i = (long long)(a); i < (long long)(b); i++)
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#include <bits/stdc++.h>
#include <sys/time.h>
using namespace std;
#define rep(i,n) for(long long i = 0; i < (long long)(n); i++)
#define repi(i,a,b) for(long long i = (long long)(a); i < (long long)(b); i++)
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
@shelaf
shelaf / aaa
Last active October 26, 2017 14:04
int[][] map = new int[][]{
new int[]{-1, 1, 1, -1, -1, 1, 1, -1, -1, 1},
new int[]{ 1, 36, 1, 0, -1, -1, -1, -1, -1, -1},
new int[]{-1, -1, -1, 1, 1, -1, 1, -1, 1, 1},
new int[]{ 1, 0, -1, -1, 1, -1, 1, -1, 1, -1},
new int[]{-1, 1, 1, -1, -1, -1, -1, 0, 1, -1},
new int[]{ 1, -1, 1, -1, -1, 1, -1, 1, -1, 1},
new int[]{-1, 0, -1, -1, -1, 1, -1, -1, -1, 1},
new int[]{-1, 1, -1, 1, 1, -1, 1, -1, -1, -1},
new int[]{-1, 1, -1, -1, -1, 1, 1, -1, -49, 1},
@shelaf
shelaf / gist:74c1851083e175349ec4c4f6eb4cd763
Created September 23, 2017 07:13
ターミナル入力時の横スクロールの設定
~/.inputrcで
horizontal-scroll-mode
の値を設定する。
on:画面の右端より後ろに入力が行われたときにコマンドラインが横にスクロールされる。
off:コマンドラインは次の行にまたがって継続される。デフォルトはoff。
GNU readlineを利用しているものに適用される。
なお、zshはreadlineを利用していない。
@shelaf
shelaf / gist:385986890ed01a0bde643004816658dd
Created August 18, 2017 03:51
A device ID has been used that is out of range for your system対策
Windows版VMwareで仮想OSとしてUbuntuをインストールした場合、
A device ID has been used that is out of range for your system.
と表示されてサウンドカードが切断される場合の対策方法。
コントロールパネル→サウンドを開く。
録音タブにて
右クリック→無効なデバイスの表示にチェック
表示されたステレオ ミキサーを右クリック→有効
@shelaf
shelaf / MapsActivity.java
Created June 17, 2017 12:49
Google Map API
package com.example.shela.myapplication;
import android.Manifest;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.FragmentActivity;
import android.support.v4.content.ContextCompat;
import android.util.Log;