Skip to content

Instantly share code, notes, and snippets.

View otiai10's full-sized avatar
๐Ÿ‘‹

Hiromu OCHIAI otiai10

๐Ÿ‘‹
View GitHub Profile
@nicolashery
nicolashery / elasticsearch.md
Last active December 30, 2023 19:03
Elasticsearch: updating the mappings and settings of an existing index

Elasticsearch: updating the mappings and settings of an existing index

Note: This was written using elasticsearch 0.9.

Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:

$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
  "_id": 1,
@voluntas
voluntas / shiguredo_tech.rst
Last active March 15, 2025 00:17
ๆ™‚้›จๅ ‚ใ‚’ๆ”ฏใˆใ‚‹ๆŠ€่ก“

ๆ™‚้›จๅ ‚ใ‚’ๆ”ฏใˆใ‚‹ๆŠ€่ก“

ๆ—ฅๆ™‚:2025-03-15
ไฝœ:ๆ™‚้›จๅ ‚
ใƒใƒผใ‚ธใƒงใƒณ:2025.2
URL:https://shiguredo.jp/

ๆ™‚้›จๅ ‚ใ‚ฏใƒฉใ‚ฆใƒ‰ใ‚ตใƒผใƒ“ใ‚นใ‚’ๆ”ฏใˆใ‚‹ๆŠ€่ก“

@JesseObrien
JesseObrien / Hello.html
Created May 29, 2013 01:30
Revel Hello World app
{{set . "title" "Home"}}
{{template "header.html" .}}
<h1>Hello {{.myName}}</h1>
<a href="/">Back to form</a>
{{template "footer.html" .}}
@fupslot
fupslot / gist:5015897
Created February 22, 2013 19:23
Javascript: Convert base64 to a Blob
function dataURItoBlob(dataURI, callback) {
// convert base64 to raw binary data held in a string
// doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
var byteString = atob(dataURI.split(',')[1]);
// separate out the mime component
var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]
// write the bytes of the string to an ArrayBuffer
var ab = new ArrayBuffer(byteString.length);
@jweir
jweir / redis-eventsource.go
Last active April 19, 2021 03:08
Example of using Redis PubSub and EventSource with golang
package main
import (
eventsource "github.com/antage/eventsource/http"
redis "github.com/vmihailenco/redis"
"log"
"net/http"
)
func haltOnErr(err error){
@taichi
taichi / testing_javascript.md
Last active February 7, 2018 00:09
javascript ใซใŠใ‘ใ‚‹ใƒฆใƒ‹ใƒƒใƒˆใƒ†ใ‚นใƒˆใซใคใ„ใฆ (2013/01)

javascript ใซใŠใ‘ใ‚‹ใƒฆใƒ‹ใƒƒใƒˆใƒ†ใ‚นใƒˆใซใคใ„ใฆ (2013/01)

ใ“ใ“ใฎๆ‰€ใ€ๆ•ฐใ‹ๆœˆใŠใใซjsใฎใƒฆใƒ‹ใƒƒใƒˆใƒ†ใ‚นใƒˆใฃใฆใฉใ†ใ‚„ใ‚‹ใฎใŒ่‰ฏใ„ใฎใ‹ๆ‚ฉใ‚“ใงใ„ใ‚‹ๆฐ—ใŒใ™ใ‚‹ใฎใงใ€ไธ€ใคๆƒ…ๅ ฑ้›†็ด„ใฎ็‚บใซใƒกใƒขๆ›ธใใ‚’ใ—ใฆใŠใใพใ™ใ€‚

ไฝ•ใ‹ใกใ‚ƒใ‚“ใจๆ–‡็ซ ๆ›ธใ„ใฆใŠใ‘ใฐใ€ใใ‚Œใซๅฏพใ™ใ‚‹ๅๅฟœใŒ้›†ใพใฃใฆใ€ใ‚ชใƒฌใ‚ตใƒžใƒใƒƒใƒ”ใƒผ็š„ใชๅฑ•้–‹ใ‚’ๆœ›ใ‚“ใงใ„ใพใ™ใ€‚

ใใ‚‚ใใ‚‚ไฝ•ใ‚’ๆŽขใ—ใฆใ„ใ‚‹ใฎใ‹

ๅ˜ไฝ“ใƒ†ใ‚นใƒˆใจใ„ใ†ใ‹ใ€ใƒฆใƒ‹ใƒƒใƒˆใƒ†ใ‚นใƒˆใจใ„ใ†ใ‹ใ€ใใ†ใ„ใ†ใ‚ขใƒฌใ‚’ๆ›ธใ็‚บใฎใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใ‚’ๆŽขใ—ใฆใ„ใพใ™ใ€‚
่ฆšใˆใ‚‹ไบ‹ใŒๅฐ‘ใชใใฆๅผทๅŠ›ใชใ‚„ใคใ€‚

ๆฉŸ่ƒฝใƒ†ใ‚นใƒˆใจใ„ใ†ใ‹ใ€e2eใƒ†ใ‚นใƒˆใ„ใ†ใ‹ใ€ใใ†ใ„ใ†ใ‚ขใƒฌใฎไบ‹ใฏๅˆฅ้€”่€ƒใˆใ‚‹ๅฟ…่ฆใŒใ‚ใ‚Šใพใ™ใฎใงใ€ไปŠๅ›žใฏใ‚นใ‚ณใƒผใƒ—ๅค–ใจใ—ใพใ™ใ€‚

@harlantwood
harlantwood / push_to_github.rb
Created June 15, 2012 07:27
Commit and push via Github REST API, from ruby RestClient
# Committing changes to a repo via the Github API is not entirely trivial.
# The five-step process is outlined here:
# http://developer.github.com/v3/git/
#
# Matt Swanson wrote a blog post translating the above steps into actual API calls:
# http://swanson.github.com/blog/2011/07/23/digging-around-the-github-api-take-2.html
#
# I was not able to find sample code for actually doing this in Ruby,
# either via the HTTP API or any of the gems that wrap the API.
# So in the hopes it will help others, here is a simple function to
@bjhess
bjhess / pull_request_webhook.md
Created May 18, 2012 15:58
The way I had to add a github repo webhook for pull requests

This is more complex than necessary.

GitHub webhooks for a URL by default only fire on repo pushes. There appears to be no way in the web UI to set up webhooks for other events. And so we go to the API. I prefer to do this type of thing with Hurl.

{
  "name": "web",
 "active": true,
@shreeshga
shreeshga / gist:1627145
Created January 17, 2012 15:45
md5sum through brew
brew install md5sha1sum