Skip to content

Instantly share code, notes, and snippets.

@kaneshin
kaneshin / main.go
Last active November 8, 2020 15:14
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"runtime"
"sync"
)
@harlow
harlow / golang_job_queue.md
Last active July 12, 2024 03:19
Job queues in Golang
- name: ユーザの作成
- user: name={{ item }} shell=/bin/bash password={{ password }} home=/home/{{ item }}
with_items:
- yamasita
- yamada
- suzuki
- name: パッケージインストール
apt: pkg=tmpreaper state=installed
@zakuroishikuro
zakuroishikuro / test_server.js
Last active September 19, 2022 16:29
HTTPリクエストをオウム返しするサーバ (Node.js勉強中)
// Node.js勉強中...HTTPリクエストをオウム返しするサーバを作ってみた
// http://qiita.com/manuluu/items/dd871a5a98e695b9129e
var http = require('http');
// サーバ作る
var server = http.createServer(function(req, res) { // HTTPリクエスト受けたら実行されるメソッド
var req_str = "";
// 読む (リクエスト行)
@hayajo
hayajo / changelog_en.md
Last active July 19, 2024 05:47
ChangeLog を支える英語

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形

@rummelonp
rummelonp / jquery-ujs.sample.md
Created December 13, 2011 02:25
jquery-ujs.js(rails.js)便利だよって話

jquery-ujs.js(rails.js)便利だよって話

自前でやる場合

JavaScript でクリックのイベント処理とか GET 以外ならトークンを含めるとか全部やらないといけないから面倒くさい

HTML

<a href="/some_action" class="some-action">some action</a>
@soemarko
soemarko / theme.html
Created November 26, 2011 16:18
embed github gist to tumblr
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->
@io41
io41 / paginated_collection.js
Created February 22, 2011 10:10 — forked from zerowidth/paginated_collection.js
Pagination with Backbone.js
// includes bindings for fetching/fetched
var PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage');
typeof(options) != 'undefined' || (options = {});
this.page = 1;
typeof(this.perPage) != 'undefined' || (this.perPage = 10);
},
fetch: function(options) {
@igaiga
igaiga / command.rb
Created January 13, 2011 08:18
shell command runner
# -*- coding: utf-8 -*-
class Command
attr_accessor :command, :status, :out
def initialize(command)
@command = command
self
end
def run
@out = `#{@command} 2>&1`
#!/usr/bin/env ruby
require 'rubygems'
require 'nokogiri'
require 'open-uri'
module JD_EXT
module FixMP3TagFromSC
class << self
def jd_webui_url
'http://localhost:8765/'