Skip to content

Instantly share code, notes, and snippets.

import java.net.URL;
public class Test1 {
public static void main(String... args) throws Exception {
URL url = new URL("http://google.com");
System.out.println(url.equals(new URL("http://google.com")));
Thread.sleep(30000);
System.out.println(url.equals(new URL("http://google.com")));
}
package main
import (
"fmt"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that result.
Fetch(url string) (body string, urls []string, err error)
package main
import (
"code.google.com/p/go-tour/tree"
"fmt"
)
// Walk walks the tree t sending all values
// from the tree to the channel ch.
func Walk(t *tree.Tree, ch chan int) {
@scheakur
scheakur / check-ctermbg-and-background.vim
Last active December 17, 2015 19:19
List color numbers which make the option 'background' to be 'dark'
for i in range(0, 255)
execute 'hi Normal ctermbg=' . i
if &background == 'dark'
echo i
endif
endfor
@scheakur
scheakur / app.yaml
Created May 11, 2013 17:55
Google App Engine で Django
application: scheakur
version: 1
runtime: python27
api_version: 1
threadsafe: false
libraries:
- name: django
version: "1.3"
def search(String fmt) {
def alpha = ('a'..'z').join('')
def num = ('0'..'9').join('')
def alphanum = alpha + num
def all = alphanum + '_'
def checkList = fmt.collect {
switch (it) {
case 'A': return alpha
case 'N': return num
<meta name="text:Hatena Star Token" content="" />
{block:IfHatenaStarToken}
<script src="http://s.hatena.com/js/HatenaStar.js"></script>
<script>
Hatena.Star.Token = '{text:Hatena Star Token}';
Hatena.Star.SiteConfig = {
entryNodes: {
'div.post': {
uri: '.title a',
title: '.title',
{block:IndexPage}
{block:IfDisqusShortname}
<p class="disqus-count"><a href="{Permalink}#disqus_thread">Comments</a>
{/block:IfDisqusShortname}
{block:IndexPage}
{block:PermalinkPage}
{block:IfDisqusShortname}
<div id="disqus_thread"></div>
<script src="http://disqus.com/forums/{text:Disqus Shortname}/embed.js"></script>
<noscript><a href="http://{text:Disqus Shortname}.disqus.com/?url=ref">{lang:View the discussion thread}</a></noscript>
function! s:load_after_colors()
let color = expand('~/.vim/after/colors/' . g:colors_name . '.vim')
if filereadable(color)
execute 'source ' color
endif
endfunction
autocmd MyColors ColorScheme * call s:load_after_colors()
class Example {
def hoge
def fuga
def piyo
def foo() { "foo" }
def bar() { "$hoge$fuga$piyo" }
}
Example.metaClass.baz = { -> "baz" }