Skip to content

Instantly share code, notes, and snippets.

View handlename's full-sized avatar

NAGATA Hiroaki handlename

View GitHub Profile
(defun my:chomp (str)
(replace-regexp-in-string "[\n\r]+$" "" str))
(defun my:git-project-p ()
(string=
(my:chomp
(shell-command-to-string "git rev-parse --is-inside-work-tree"))
"true"))
(defun my:tmux-do-command-for-file (filepath command)
(defun my:chomp (str)
(replace-regexp-in-string "[\n\r]+$" "" str))
(defun my:git-project-p ()
(string=
(my:chomp
(shell-command-to-string "git rev-parse --is-inside-work-tree"))
"true"))
(defun my:tig-blame-current-file ()
notify_start_time=0
notify_end_time=0
notify_threshold=10
notify_threshold2=30
notify_prev_command=""
notify_flag=0
function notify_preexec {
notify_flag=1
notify_start_time=`date +'%s'`
;;; np.el --- post region to no-paste
;; Copyright (C) 2012-2013 NAGATA Hiroaki (handlename)
;;; Commentary:
;; (defvar np:endpoint "API ENDPOINT")
;; (defvar np:username "USERNAME")
;; (defvar np:password "PASSWORD")
;; (global-set-key (kbd "C-c C-p") 'np:post-region)
@handlename
handlename / notify.zsh
Last active February 16, 2018 05:58
notify after heavy command execution.
notify_start_time=0
notify_end_time=0
notify_threshold=10
notify_prev_command=""
notify_flag=0
function notify_preexec {
notify_flag=1
notify_start_time=`date +'%s'`
notify_prev_command="$2"
@handlename
handlename / shibuya-el-position-paper.md
Created August 19, 2012 23:55 — forked from ainame/shibuya-el-position-paper.md
shibuya.elのポジションペーパーです。
@handlename
handlename / intersect.pl
Created July 23, 2012 14:05
intersection for multiple lists
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use Data::Dumper;
sub intersect {
my @lists = grep { scalar @$_ } @_;
@handlename
handlename / t.sh
Created March 26, 2012 14:58
create new window and exec command in it.
#!/bin/sh
tmux new-window "$*"
@handlename
handlename / s.sh
Created March 26, 2012 14:56
split window and exec shell command in new pane.
#!/bin/sh
tmux split-window -h "$*"
@handlename
handlename / canything.rb
Created March 26, 2012 02:23
Homebrew Formula for canything.
require 'formula'
class Canything < Formula
url 'https://github.com/keiji0/canything/zipball/master'
sha1 '85d243ee8f98b393e165ce16def61640949431dd'
homepage 'https://github.com/keiji0/canything'
version '20110511'
def patches;
DATA;