Skip to content

Instantly share code, notes, and snippets.

@atton
atton / tmux-2.2-setlocale-ja_JP.UTF-8.txt
Last active August 23, 2016 02:51
Set locale for tmux 2.2
diff --git tmux.c tmux.c
index cf82110..d2c57b8 100644
--- tmux.c
+++ tmux.c
@@ -193,12 +193,7 @@ main(int argc, char **argv)
int opt, flags, keys;
if (setlocale(LC_CTYPE, "en_US.UTF-8") == NULL) {
- if (setlocale(LC_CTYPE, "") == NULL)
- errx(1, "invalid LC_ALL, LC_CTYPE or LANG");
diff --git a/data/charwidths.jl b/data/charwidths.jl
index bdcbc6c..25d8d9f 100644
--- a/data/charwidths.jl
+++ b/data/charwidths.jl
@@ -111,7 +111,7 @@ for line in readlines(open("EastAsianWidth.txt"))
#Assign widths
for c in charstart:charend
- if width=="W" || width=="F" # wide or full
+ if width=="W" || width=="F" || width=="A" # wide or full
diff --git a/data/charwidths.jl b/data/charwidths.jl
index bdcbc6c..25d8d9f 100644
--- a/data/charwidths.jl
+++ b/data/charwidths.jl
@@ -111,7 +111,7 @@ for line in readlines(open("EastAsianWidth.txt"))
#Assign widths
for c in charstart:charend
- if width=="W" || width=="F" # wide or full
+ if width=="W" || width=="F" || width=="A" # wide or full
@atton
atton / ancestors.rb
Last active December 3, 2016 08:31
okinawa.rb advent calendar 2016
# [13] pry(#<#<Class:0x007ffdce310d48>>)> puts (p self.class.ancestors)
[#<Class:0x007ffdce310d48>,
#<Module:0x007ffdcead5600>,
#<Module:0x007ffdce9c6f48>,
UsersHelper,
ApplicationHelper,
#<Module:0x007ffdcd741030>,
ActionDispatch::Routing::RouteSet::MountedHelpers,
#<Module:0x007ffdce310ca8>,
#<Module:0x007ffdcd1a8c68>,
@atton
atton / ignore
Last active June 8, 2017 11:13
~/.config/git/ignore
# ~/.config/git/ignore
.DS_Store
*.swp
@atton
atton / inspect.json
Created June 13, 2017 03:13
docker inspect json
"Mounts": [
{
"Name": "98ef888300af713d65b6d7534d835c7bd2e95270ad5eb016da749bbbb5f6d409",
"Source": "/var/lib/docker/volumes/98ef888300af713d65b6d7534d835c7bd2e95270ad5eb016da749bbbb5f6d409/_data",
"Destination": "/var/jenkins_home",
"Driver": "local",
"Mode": "",
"RW": true,
"Propagation": ""
}
cat > /usr/lib/systemd/system/httpd.service << EOF
[Unit]
Description=The Apache HTTP Server
After=network.target remote-fs.target nss-lookup.target
Documentation=man:httpd(8)
Documentation=man:apachectl(8)
[Service]
Type=notify
#EnvironmentFile=/usr/local/apache2/conf/httpd.conf
@atton
atton / redis.service
Created July 7, 2017 08:07
install-redis 3.2.9
[Unit]
Description=Redis persistent key-value database
After=network.target
[Service]
ExecStart=/usr/local/bin/redis-server /etc/redis.conf --daemonize no
ExecStop=/usr/local/bin/redis-cli -p 6379 shutdown
[Install]
WantedBy=multi-user.target
@atton
atton / data-remote-false.rb
Created August 31, 2017 04:45
rails 5.1 form_with
form_with(url: hoge_url, data: {remote: false})
[3] pry(main)> RGhost::Convert.new(nil).to :jpeg
NoMethodError: undefined method `empty?' for nil:NilClass
from /Users/atton/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rghost-141a28abb655/lib/rghost/ruby_ghost_engine.rb:156:in `shellescape'
[5] pry(main)> RGhost::Convert.new(true).to :jpeg
NoMethodError: undefined method `empty?' for nil:NilClass
from /Users/atton/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rghost-141a28abb655/lib/rghost/ruby_ghost_engine.rb:156:in `shellescape'