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
select relname,n_live_tup,n_dead_tup,last_vacuum,last_autovacuum from pg_stat_all_tables order by n_dead_tup desc limit 20; |
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
select relname,(relpages/128) mbytes from pg_class order by mbytes desc limit 20; |
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
data Hoge = Foo | Bar | |
-- to_s :: Hoge -> String | |
to_s Foo = "foo" | |
main = do | |
putStrLn $ to_s Foo | |
putStrLn $ to_s Bar |
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
#!/usr/bin/env ruby | |
require 'optparse' | |
if not File.exist? ".vagrant" | |
puts "not vagrant directory" | |
return -1 | |
end | |
if not File.exist? ".vagrant_ssh_config" |
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
func TestWhyNotPost(t *testing.T) { | |
testServerPort := 31337 | |
testServerAddr := fmt.Sprintf("127.0.0.1:%d", testServerPort) | |
testServerRootURL := fmt.Sprintf("http://%s/", testServerAddr) | |
srv := &Server{} | |
listener, err := net.ListenTCP("tcp4", &net.TCPAddr{IP: net.IPv4(127, 0, 0, 1), Port: testServerPort}) | |
if err != nil { | |
panic(err) | |
} |
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 main | |
import "fmt" | |
func copyNg() { | |
src := []int{0, 1, 2, 3, 4} | |
dest := src[0:1] | |
dest = append(dest, src[4:5]...) |
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 main | |
import ( | |
"fmt" | |
"net" | |
"net/http" | |
) | |
type MyMux struct { | |
} |
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
; HyperSpec/Body/s_flet_.htm | |
(defun foo (x flag) | |
(macrolet ((fudge (z) | |
;The parameters x and flag are not accessible | |
; at this point; a reference to flag would be to | |
; the global variable of that name. | |
` (if flag (* ,z ,z) ,z))) | |
;The parameters x and flag are accessible here. | |
(+ x | |
(fudge x) |
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
require 'yaml' | |
def escape str | |
str = str.chars.map{|c| | |
if c == "\n" | |
"\\n" | |
elsif c == "\r" | |
"\\r" | |
elsif c == "\t" | |
"\\t" |
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 main | |
import ( | |
"bytes" | |
"os" | |
"github.com/k0kubun/pp" | |
u "github.com/kawakami-o3/undergo" | |
) |