Skip to content

Instantly share code, notes, and snippets.

View flatfisher's full-sized avatar
🎣
Fishing

Kyohei Tsuda flatfisher

🎣
Fishing
  • MIXI, Inc.
  • Japan
View GitHub Profile
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@aodin
aodin / gist:9493190
Last active March 23, 2024 20:24
Parsing JSON in a request body with Go
package main
import (
"encoding/json"
"io/ioutil"
"log"
"net/http"
)
type Message struct {
@iamphill
iamphill / RegexHandler.go
Last active May 9, 2022 02:12
Very basic golang HTTP server
package main
import (
"net/http"
"Regexp"
)
type route struct {
pattern *regexp.Regexp
handler http.Handler
@hayakawatomoaki
hayakawatomoaki / npm error [ env: node: No such file or directory ]
Last active September 15, 2021 08:00
npmで「env: node: No such file or directory」とエラーが出たときの対応
$ npm -v
module.js:338
throw err;
^
Error: Cannot find module 'npmlog'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:18:11
@rythie
rythie / hello_world.yml
Last active February 28, 2022 18:38
Ansible hello world example
# To run this, name this file hello_world.yml and run the following in the same directory
# ansible-playbook hello_world.yml -i 'local,' --connection=local
- hosts:
- local
tasks:
- name: Create a directory
file: path=hello_world state=directory
'use strict';
function getInstance(consumer_key, consumer_secret) {
return new TwitterWebService_(consumer_key, consumer_secret);
}
var TwitterWebService_ = function (consumer_key, consumer_secret) {
this.consumer_key = consumer_key;
this.consumer_secret = consumer_secret;
}
@reagent
reagent / 00_README.md
Last active January 29, 2024 13:31
Custom HTTP Routing in Go

Custom HTTP Routing in Go

Basic Routing

Responding to requests via simple route matching is built in to Go's net/http standard library package. Just register the path prefixes and callbacks you want invoked and then call the ListenAndServe to have the default request handler invoked on each request. For example:

package main

import (
@voluntas
voluntas / gae_go.rst
Last active March 15, 2019 16:31
GAE/Go コトハジメ

GAE/Go コトハジメ

日時:2017-07-21
作:@voluntas
バージョン:0.6.0
URL:https://voluntas.githu.io/

突っ込みは Twitter @voluntas まで。

@shunirr
shunirr / criminal_jc.md
Last active February 26, 2024 05:51
女子中学生チケット詐欺事件

criminal_jc