Want to create a Gist from your editor, the command line, or the Services menu? Here's how.
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
/* | |
* get screenshot PNG from web page | |
* | |
* build: | |
* FLAGS=`pkg-config --cflags --libs gtk+-x11-2.0 glib-2.0 webkit-1.0` | |
* gcc -Wall $FLAGS getscreenshot.c -o getscreenshot | |
* | |
* usage: | |
* /usr/bin/xvfb-run -s "-screen 0 1024x768x24" ./getscreenshot test.html | |
* |
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
@echo off | |
if "%1" == "-f" goto doit | |
if "%1" == "-s" goto session | |
if not "%SSH_AGENT_PID%" == "" goto end | |
goto doit | |
:session | |
for /f "eol=; tokens=1,2 delims==;" %%1 in ('ssh-agent.exe') do ( | |
if "%%1" == "SSH_AUTH_SOCK" setx SSH_AUTH_SOCK %%2 & set SSH_AUTH_SOCK=%%2 | |
if "%%1" == "SSH_AGENT_PID" setx SSH_AGENT_PID %%2 & set SSH_AGENT_PID=%%2 |
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! s:package_name() | |
let mx = '^\s*package\s\+\([^ ;]\+\)' | |
for line in getline(1, 5) | |
if line =~ mx | |
return substitute(matchstr(line, mx), mx, '\1', '') | |
endif | |
endfor | |
return "" | |
endfunction |
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
package MyFinger; | |
use Filter::Simple; | |
FILTER_ONLY | |
code => sub { | |
s/(\$[a-zA-Z][a-zA-Z0-9]*\s*)☞/\1->/msxg; | |
s/([a-zA-Z][a-zA-Z0-9]*\s*)☛/\1=>/msxg; | |
}; | |
1; |
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
// gcc -o closure-counter closure-counter.c -lffi | |
#include <stddef.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <ffi.h> | |
int | |
main(int argc, char **argv) { | |
ffi_cif cif; |
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
#!perl | |
# 日本の祝日をGoogleから持ってくるスクリプト | |
use strict; | |
use LWP::UserAgent; | |
use POSIX qw(strftime); | |
use URI; | |
use JSON::XS; | |
use XML::LibXML; | |
use XML::LibXML::XPathContext; |
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! s:make_counter(init) | |
let ret = {"count": a:init} | |
function! ret.countup() dict | |
let self.count = self.count + 1 | |
return self.count | |
endfunction | |
return ret | |
endfunction | |
unlet! c |
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
↑のStar押してみて! |
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
*** zencoding.vim.org 2010-07-09 12:07:33.000000000 +0900 | |
--- zencoding.vim 2010-07-09 20:00:47.000000000 +0900 | |
*************** | |
*** 2131,2134 **** | |
--- 2131,2143 ---- | |
return [[line("'<"), col("'<")], [line("'>"), col("'>")]] | |
endfunction | |
+ function g:get_zen_snippets_list(type) | |
+ let type = a:type |
OlderNewer