Skip to content

Instantly share code, notes, and snippets.

View 1syo's full-sized avatar

Kazunari Takahashi 1syo

View GitHub Profile
function run() {
var query = "{query}";
var app = Application.currentApplication();
app.includeStandardAdditions = true;
var path = app.pathTo("home folder", {from:"user domain"}) + "/.ssh/config"
var fd = app.openForAccess(path, { writePermission: false });
var text = app.read(fd, {as: "text"});
app.closeAccess(fd);
function run() {
var query = "{query}"
if (query == '' || isNaN(query)) {
query = 30;
}
var app = Application.currentApplication();
app.includeStandardAdditions = true;
PathName = function(path) {
this.path = path;
this.elements = path.split('/');
this.length = this.elements.length;
}
PathName.prototype.serviceName = function() {
var string = this.elements[4];
switch (string) {
on alfred_script(q)
tell application "System Events"
if not (exists (processes where name is "Terminal")) then
tell application "Terminal"
activate
do script q in first window
end tell
else
tell application "Terminal"
activate
create_table "users" do |t|
t.string "name", null: false
end
create_table "itames" do |t|
t.string "name", null: false
t.t.integer "category_id", limit: 4, null: false
t.t.integer "user_id", limit: 4, null: false
end
alias c='cd `git rev-parse --show-toplevel`'
alias apacheawk="gawk -vFPAT='([^ ]+)|(\"[^\"]+\")|(\\\\[[^\\\\]]+\\\\])' "
alias be='bundle exec'
@1syo
1syo / mkd
Created October 28, 2016 07:43
#! /usr/bin/env ruby
begin
require 'github/markup'
rescue LoadError
Gem.install 'github-markup'
retry
end
begin
# $Id: screenrc,v 1.15 2003/10/08 11:39:03 zal Exp $
#
# /etc/screenrc
#
# This is the system wide screenrc.
#
# You can use this file to change the default behavior of screen system wide
# or copy it to ~/.screenrc and use it as a starting point for your own
# settings.
#
@1syo
1syo / .zshrc
Created October 25, 2016 14:55
export ZPLUG_HOME=/usr/local/opt/zplug
source $ZPLUG_HOME/init.zsh
function ruby_prompt_ifno {
if which rbenv > /dev/null; then
echo "$(rbenv version-name)"
else
echo "system"
fi
box: ubuntu
build:
steps:
- install-packages:
packages: bats
- script:
name: test
code: bats test
after-steps:
- 1syo/idobata-notify@0.2.3: