Skip to content

Instantly share code, notes, and snippets.

function nyaos.command.pcd()
local complst = nyaos.default_complete("", 1)
local buf = ""
for i, e in ipairs(complst) do
-- nyaos.statが通らないので、
-- 末尾のスラッシュ、バックスラッシュを削除
local f = e[2]:gsub('(.+)[\\/]$', '%1')
local stat = nyaos.stat(f)
if (stat and stat.directory) then
buf = buf .. '\n' .. e[2]
diff -r 0ae1d837abbd -r 0bc675381e3a content/css/tabsontop_off.css
--- a/content/css/tabsontop_off.css Wed Jul 23 19:27:51 2014 +0900
+++ b/content/css/tabsontop_off.css Wed Jul 23 19:30:33 2014 +0900
@@ -40,7 +40,7 @@
#TabsToolbar,
#TabsToolbar:not(:-moz-lwtheme),
#main-window[tabsintitlebar][sizemode="normal"] #toolbar-menubar[autohide="true"][inactive="true"]:not([customizing="true"]) ~ #TabsToolbar{
- margin-top: 0px !important;
+ margin-top: -18px !important;
}
@nocd5
nocd5 / vim.rb
Last active August 29, 2015 14:04
Windowsでも`vim -g`と出来るようにするRubyスクリプト。
#!/usr/bin/env ruby
$args = ARGV
$option = Array.new
$file = Array.new
# オプションとファイルに分割
pos = $args.index("--")
if !pos.nil? then
$option = $args[0, pos]
g_luaiconv = nil
g_utf82sjis = nil
function my_print(str)
if (g_luaiconv == nil) then
g_luaiconv = require('luaiconv')
end
if (g_utf82sjis == nil) then
g_utf82sjis = g_luaiconv.new('sjis', 'utf-8')
end
dest = g_utf82sjis:iconv(str)
@nocd5
nocd5 / gist:321b18f536bc8ece892b
Created September 3, 2014 23:12
ダイナミックリンク版mruby.exeビルドメモ
gcc -I ../../../include -I ../../../src -L . ../../../mrbgems/mruby-bin-mruby/tools/mruby/mruby.c -o mruby.exe -Wl,-dy,-lmruby
@nocd5
nocd5 / pcd_for_nyagos.lua
Created September 20, 2014 15:43
nyagosでpecoを使ったディレクトリ移動を行う
alias{
pcd = function ()
local line = nyagos.eval("ls -la") -- nyagos組み込みの`ls`
local complst = split(line, "[\r\n]")
local directories = ""
for i, e in ipairs(complst) do
-- 末尾が'/'ならディレクトリって事で決め打ち
if (e:match('.+/$')) then
-- ls -lの結果が
-- <パーミション> <サイズ> <日付> <時間> <ファイル名 or ディレクトリ名>
@nocd5
nocd5 / helloworld.c
Last active August 29, 2015 14:08
gistと連携したらどうなるんだろう? ref: http://qiita.com/nocd5/items/1c44e37dca92b0b2bdca
#include <stdio.h>
int main(){
printf("Hello World!\n");
return 0;
}
@nocd5
nocd5 / .nyagos
Created November 1, 2014 15:23
nyagosで`echo $PATH`とかしたい ref: http://qiita.com/nocd5/items/aa155e91a6eef58b3940
local _filter = nyagos.filter
nyagos.filter = function(cmdline)
local post = cmdline:gsub('${([%w_()]+)}', '%%%1%%')
post = post:gsub('$([%w_()]+)', '%%%1%%')
return _filter(post)
end
@nocd5
nocd5 / history_pointor_reset.patch
Created November 17, 2014 05:37
ヒストリのサーチポインタの初期化タイミング調整
diff --git a/history/history.go b/history/history.go
index 8bdf08d..b7f7e7d 100644
--- a/history/history.go
+++ b/history/history.go
@@ -341,3 +341,7 @@ func Load(path string) error {
}
return nil
}
+
+func ResetPointor() {
#!/bin/sh
mkdir -p build
pushd build
tar zxvf ../libevent-2.0.21-stable.tar.gz
pushd libevent-2.0.21-stable
./configure
make
popd