This file contains hidden or 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 main | |
| import "math" | |
| import "code.google.com/p/go-tour/pic" | |
| func Pic(dx, dy int) [][]uint8 { | |
| pic := make([][]uint8, dy) | |
| for y := range pic { | |
| line := make([]uint8, dx) | |
| pic[y] = line |
This file contains hidden or 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 main | |
| import ( | |
| "fmt" | |
| ) | |
| func Sqrt(x float64) float64 { | |
| return _sqrt(x, 0, 10); | |
| } |
This file contains hidden or 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
| #! /usr/bin/env ruby | |
| source = ARGV.first | |
| dest = '' | |
| def extract(word) | |
| if `look #{word}`.split(/\n/).include? word | |
| return word | |
| end |
This file contains hidden or 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
| ;; This function is quoted from this page. Thanks to Tomohiro Matsuyama. | |
| ;; http://dev.ariel-networks.com/Members/matsuyama/pretty-lambda-in-emacs/ | |
| (defun set-pretty-patterns (patterns) | |
| (loop for (glyph . pairs) in patterns do | |
| (loop for (regexp . major-modes) in pairs do | |
| (loop for major-mode in major-modes do | |
| (let ((major-mode (intern (concat (symbol-name major-mode) "-mode"))) | |
| (n (if (string-match "\\\\([^?]" regexp) 1 0))) | |
| (font-lock-add-keywords major-mode | |
| `((,regexp (0 (prog1 () |
This file contains hidden or 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
| <div style="position: fixed; bottom: 0; right: 0; opacity: 0.8;z-index:10000"><iframe width="420" height="315" src="//www.youtube.com/embed/Qp9-V3QSafA?autoplay=1" frameborder="0" allowfullscreen></iframe><br><iframe width="420" height="315" src="//www.youtube.com/embed/dQw4w9WgXcQ?autoplay=1" frameborder="0" allowfullscreen></iframe></div> |
This file contains hidden or 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
| #! /usr/bin/env ruby | |
| # Copy random LGTM to clipboard | |
| require 'open-uri' | |
| require 'nokogiri' | |
| require 'shellwords' | |
| doc = Nokogiri open('http://www.lgtm.in/g') |
This file contains hidden or 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
| #! /usr/bin/env casperjs | |
| # ./shindan_casper.coffee '趣味はマリンスポーツです' | |
| casper = do (require 'casper').create | |
| casper.start 'http://shindanmaker.com/c/list?mode=hot', -> | |
| href = @evaluate -> | |
| links = (document.querySelectorAll '.list_title') | |
| links[Math.floor (do Math.random * links.length)].href |
This file contains hidden or 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
| lib/HTTP/Message/PSGI.pm | t/Plack-Test/suite.t | |
|---|---|---|
| lib/HTTP/Server/PSGI.pm | t/Plack-Middleware/dechunk.t | |
| lib/Plack.pm | t/Plack-Middleware/content_length.t | |
| lib/Plack/App/CGIBin.pm | t/Plack-Middleware/cgibin.t | |
| lib/Plack/App/Cascade.pm | t/Plack-Middleware/cascade.t | |
| lib/Plack/App/Directory.pm | t/Plack-App/directory.t | |
| lib/Plack/App/File.pm | t/Plack-Middleware/directory.t | |
| lib/Plack/App/PSGIBin.pm | t/Plack-Middleware/psgibin.t | |
| lib/Plack/App/URLMap.pm | t/Plack-Middleware/urlmap.t | |
| lib/Plack/App/WrapCGI.pm | t/Plack-Middleware/wrapcgi.t |
This file contains hidden or 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
| #!/usr/bin/env perl | |
| use v5.14; | |
| use strict; | |
| use warnings; | |
| use TAP::Harness; | |
| package ReverseSession { | |
| use Perl6::Say; | |
| use Encode qw(encode_utf8 decode_utf8); |
This file contains hidden or 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
| # encoding: utf-8 | |
| require 'thread' | |
| notification :growl | |
| class TestRunner | |
| def initialize | |
| @mutex = Mutex.new | |
| end |