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
package main
import (
"context"
"log"
"net/http"
"time"
)
func main() {
@kaneshin
kaneshin / opacity.js
Created October 7, 2012 10:48
change opacity when scrolling
$(document).ready(function() {
$(window).scroll(function() {
if ($(this).scrollTop() > 0) {
$('header').css('opacity', 0.8);
} else {
$('header').css('opacity', 1);
}
});
});
package slackutil
import (
"testing"
"github.com/stretchr/testify/assert"
)
func Test_Replacer(t *testing.T) {
r := NewReplacer(nil)
package main
import (
"bufio"
"context"
"flag"
"fmt"
"os"
"os/signal"
"sync"
" use emacs key bind during command mode and a movement of insert mode
" start of line
cnoremap <c-a> <Home>
inoremap <c-a> <Home>
" back one character
cnoremap <c-b> <Left>
inoremap <c-b> <Left>
" delete character under cursor
cnoremap <c-d> <Del>
inoremap <c-d> <Del>
package main
import (
"bytes"
"fmt"
"os/exec"
)
func main() {
cmd := exec.Command("ls", "-lf")
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
package main
import (
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/assert"
package main
import (
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/assert"
package main
import (
"log"
"net/http"
)
func pingHandler() func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/plain")