Skip to content

Instantly share code, notes, and snippets.

View tkfm-yamaguchi's full-sized avatar

Takafumi Yamaguchi tkfm-yamaguchi

View GitHub Profile
get %r|^/github(/.+\.js)$| do
require 'net/https'
uri = params[:captures].first
js = ""
github = Net::HTTP.new("raw.github.com", 443)
github.use_ssl = true # do not forget this to access with HTTPS protocol
github.start do
## XXX: verify the http response status
@tkfm-yamaguchi
tkfm-yamaguchi / pathname.py
Last active December 28, 2015 00:09
ruby like pathname class for python
# coding: utf-8
import os
from os import path
import re
import shutil
from itertools import chain
DEFAULT_SEPARATOR = "/"
@tkfm-yamaguchi
tkfm-yamaguchi / gvim.desktop
Last active December 27, 2015 12:59
The configuration file of (g)vim for Unity Launcher ( place this to ~/.local/share/applications/ )
[Desktop Entry]
Version=7.4
Type=Application
Name=Vi IMproved GUI
Exec="<%= HOME %>/local/app/vim/bin/gvim" %f
Icon=<%= HOME %>/Pictures/icons/vimconf2013-icon.png
Comment=The Ultimate Text Editor
Categories=Utility;TextEditor;
Terminal=false
require 'yaml'
require 'json'
require 'pathname'
BASEDIR = Pathname(File.expand_path(File.dirname(__FILE__)))
CONFPATH = BASEDIR.join("config.yaml")
result = {}

hyde.plugin.Plugin's events

  • begin_generator

    • Called when generation is about to take place.
  • begin_site

    • Called when the site is loaded completely. This implies that all the nodes and resources have been identified and are accessible in the site variable.
[ui]
username = ""
verbose = True
[defaults]
glog = --color always
[pager]
pager = LESS='FSRX' less
#ignore = version, help, update, serve, record
class String
def optimize_shebang
self.gsub! /^\#(?!\!)/, "#!"
end
end
def filenames
Dir.entries("usr/local/bin").delete_if{|f| f=~/(^\.\.?$)|(\.rb$)/}
end
@tkfm-yamaguchi
tkfm-yamaguchi / install-vim.sh
Last active December 18, 2015 18:49
installation script for vim
#!/bin/bash
# coding: utf-8
set -ex
# --------------------
VIM_NAME=vim
VIM_SRC_DIR="$HOME/local/src/github.com/vim/vim"