This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fzf-cdr () { | |
local selected_dir=$(cdr -l | awk '{ print $2 }' | fzf --query "$LBUFFER") | |
if [ -n "$selected_dir" ]; then | |
BUFFER="cd ${selected_dir}" | |
zle accept-line | |
fi | |
zle clear-screen | |
} | |
zle -N fzf-cdr | |
bindkey "^x^b" fzf-cdr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ghq-fzf() { | |
local selected_dir=$(ghq list --full-path | fzf --query="$LBUFFER") | |
if [ -n "$selected_dir" ]; then | |
BUFFER="cd ${selected_dir}" | |
zle accept-line | |
fi | |
zle reset-prompt | |
} | |
zle -N ghq-fzf | |
bindkey "^g" ghq-fzf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ssh-fzf () { | |
local selected_host=$(grep "Host " ~/.ssh/config | cut -b 6- | fzf --query "$LBUFFER") | |
if [ -n "$selected_host" ]; then | |
BUFFER="ssh ${selected_host}" | |
zle accept-line | |
fi | |
zle reset-prompt | |
} | |
zle -N ssh-fzf | |
bindkey '^\' ssh-fzf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function history-fzf() { | |
BUFFER=$(history -n -r 1 | fzf --no-sort +m --query "$LBUFFER" --prompt="History > ") | |
CURSOR=$#BUFFER | |
zle reset-prompt | |
} | |
zle -N history-fzf | |
bindkey '^r' history-fzf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%module openbabel | |
%{ | |
// used to set import/export for Cygwin DLLs | |
#ifdef WIN32 | |
#define USING_OBDLL | |
#endif | |
#include <openbabel/obutil.h> | |
#include <openbabel/rand.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# using: utf-8 | |
import os | |
import sys | |
# constant | |
plist_name = 'net.camph.auto-attend.plist' | |
def main(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <assert.h> | |
#include <sys/time.h> | |
double getETime() { | |
struct timeval tv; | |
gettimeofday(&tv, NULL); |