Skip to content

Instantly share code, notes, and snippets.

View kaneshin's full-sized avatar
🏠
Working from home

Shintaro Kaneko kaneshin

🏠
Working from home
View GitHub Profile
let chin = "kami"
let {chin}po = "foo"
echo kamipo
diff --git a/autoload/quickrun/module.vim b/autoload/quickrun/module.vim
index e81fab5..ef45604 100644
--- a/autoload/quickrun/module.vim
+++ b/autoload/quickrun/module.vim
@@ -33,6 +33,9 @@ function! s:templates.runner.run(commands, input, session)
throw 'quickrun: A runner should implements run()'
endfunction
function! s:templates.runner.shellescape(str)
+ if a:str !~ '\n'
+ return a:str
#include <stdio.h>
int
main(int argc, char* argv[]) {
int n;
for (n = 0; n < argc; n++) {
printf("%s\n", argv[n]);
}
return 0;
}
scriptencoding utf-8
let url = 'http://www.tepco.co.jp'
let indexj = '/cc/press/index-j.html'
let res = webapi#http#get(url.indexj)
if res.header[0] != 'HTTP/1.1 200 OK'
echo 'Oops! Something wrong.'
endif
let data = iconv(res.content, 'utf-8', &encoding)
let dom = webapi#html#parse(data)
//
// HTTPLoader.h
//
#import <Foundation/Foundation.h>
typedef void(^ HTTPLoaderCompletionBlock)(NSData *data, NSError *erorr);
@interface HTTPLoader : NSObject
@moro
moro / unit_test_spec.rb
Created September 19, 2012 02:31
unit_test_spec.rb
class A
def foo(num)
%w[one two three][num - 1]
end
end
describe A do
describe "#foo" do
RSpec::Matchers.define :do_foo do |args|
match do |instance|
package main
import (
"fmt"
"sync"
"time"
)
const (
maxConcurrency = 10
@cagatay
cagatay / app.yaml
Created October 18, 2011 19:14 — forked from darktable/app.yaml
App.yaml designed for serving a static site on Google App Engine (Python). Copy your static html and files into a folder called "static" next to app.yaml. Contains a bunch of mimetype declarations from html5boilerplate's .htaccess. May not be necessary
application: your-app-name
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest
@tkarpinski
tkarpinski / github_issues_to_csv.rb
Created April 12, 2012 18:09 — forked from henare/github_issues_to_csv.rb
Exports Github issues to CSV (API v3)
require 'octokit'
require 'csv'
require 'date'
# Github credentials to access your private project
USERNAME="USER_NAME"
PASSWORD="SEKRIT"
# Project you want to export issues from
USER="REPO_OWNER"
PROJECT="REPO_NAME"
# ~/.gitconfig from @boblet
# initially based on http://rails.wincent.com/wiki/Git_quickstart
[core]
excludesfile = /Users/oli/.gitignore
legacyheaders = false # >git 1.5
quotepath = false
# http://stackoverflow.com/questions/136178/git-diff-handling-long-lines
pager = less -r
# if ↑ doesn’t work, try: pager = less -+$LESS -FRX