Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <time.h>
enum {
MAX = 10,
};
typedef struct Nameval Nameval;
struct Nameval {
char *name;
#!/bin/bash
TARGET_DIR=`hostname -s`
cd /Volumes/Time\ Machine\ バックアップ
ls -le
sudo mv Backups.backupdb Backups.backupdb~
cd Backups.backupdb\~/
sudo chmod -N ${TARGET_DIR}
ls -le
sudo chmod a+r ${TARGET_DIR}
#compdef jsx
_arguments -C \
'(- 1 *)--help[displays this help and exits]' \
'(- 1 *)--version[displays displays the version and exits]' \
'(--add-search-path)--add-search-path[add a path to library search paths]:Search Path:' \
'(--executable)--executable[compiles as an CLI executable, calling _Main.main(\:string\[\])\:void]' \
'(--run)--run[runs _Main.main(\:string\[\])\:void after compiling]' \
'(--test)--test[runs _Test#test*()\:void after compiling]' \
'(--output)--output[output file (default\:stdout)]:output file:_files' \
'(--mode)--mode[compilation mode (default\:compile)]:compilation mode:(compile parse)' \
_jsx()
{
local cur prev
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
JSX_OPTIONS='\
--add-search-path\
--executable\
--run\
#!/usr/bin/perl
# Copyright (C) 2011 DeNA Co.,Ltd.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
--- src/wordbuf.c.orig 2012-07-31 15:24:23.000000000 +0900
+++ src/wordbuf.c 2012-07-31 15:24:38.000000000 +0900
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include "wordbuf.h"
#define WORDLEN_DEF 64
@ywatase
ywatase / _knife
Created October 2, 2012 12:34
zsh completion for knife of chef
#compdef knife
_knife_all_subcommand_with_desc () {
_subcommands=(${(@f)"$(knife --help | perl -e 'while(<>){/\A\*\*\s(.+)(?:\sCOMMANDS)?\s\*\*\s*\z/ or next; (my $desc = lc($1))=~s/\s+commands//;($line = <>)=~/knife\s($desc)/; print qq{$1\n$desc\n};}')"})
_1st_arguments=(${(k)_subcommands})
}
_knife_subsubcommand() {
_2nd_arguments=(${(@f)"$(knife $1 --help | perl -nle "/^knife\\s$1\\s(.*)/; print \$1;")"})
}
@ywatase
ywatase / _perlbrew
Created November 23, 2012 09:29
zsh completion for perlbrew
#compdef perlbrew
typeset -A opt_args
local context state line
_arguments -C \
'(- 1 *)'{-h,--help}'[prints help]' \
'(-f --force)'{-f,--force}'[Force installation of a perl]' \
'(-q --quiet)'{-q,--quiet}'[Log output to a log file rather than STDOUT. This is the default.]' \
'(-v --verbose)'{-v,--verbose}'[Log output to STDOUT rather than a logfile]' \
dy.appendChild((function(){
var s = document.createElement("script");
s.type = "text/javascript";
s.src = "http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
s.onload = function() {
window.jQuery.noConflict();
};
return s;
})());
}
@ywatase
ywatase / _plenv.zsh
Last active December 11, 2015 11:48
#compdef plenv
# Installation
#
# * rename '_plenv.zsh' to '_plenv'
# * put on $HOME/.zsh/functions/
typeset -A opt_args
local context state line