Skip to content

Instantly share code, notes, and snippets.

View giwa's full-sized avatar

Ken Takagiwa giwa

  • Nombre Premier
  • Tokyo
View GitHub Profile
@alecxe
alecxe / runner.py
Last active August 23, 2023 14:19
Self-contained minimum example script to run scrapy
import json
from scrapy.crawler import Crawler
from scrapy.contrib.loader import ItemLoader
from scrapy.contrib.loader.processor import Join, MapCompose, TakeFirst
from scrapy import log, signals, Spider, Item, Field
from scrapy.settings import Settings
from twisted.internet import reactor
@kachayev
kachayev / concurrency-in-go.md
Last active March 11, 2024 11:27
Channels Are Not Enough or Why Pipelining Is Not That Easy
@shu0115
shu0115 / circle.yml
Created June 25, 2014 03:18
CircleCI on Heroku - 簡易自動デプロイ circle.ymlサンプル ref: http://qiita.com/shu_0115/items/496f3c46b09bbbba4d02
deployment:
staging:
branch: staging
commands:
- curl https://slack.com/api/chat.postMessage -X POST -d 'channel=#heroku' -d 'text=【START】ステージング環境へのデプロイを開始しました。' -d 'username=circle_ci' -d 'token=xoxp-xxxxxxxxxx'
- git push git@heroku.com:MY-APP-NAME.git $CIRCLE_SHA1:refs/heads/master
- heroku run rake db:migrate --app MY-APP-NAME
- curl https://slack.com/api/chat.postMessage -X POST -d 'channel=#heroku' -d 'text=【END】ステージング環境へのデプロイが完了しました。' -d 'username=circle_ci' -d 'token=xoxp-xxxxxxxxxx'
@staltz
staltz / introrx.md
Last active May 7, 2024 09:38
The introduction to Reactive Programming you've been missing
@ChangUk
ChangUk / GibbsLDA.py
Last active April 19, 2021 12:05
Collapsed Gibbs sampler for Latent Dirichlet Allocation
#-*- coding: utf-8 -*-
"""
GIBBS SAMPLING IMPLEMENTATION FOR LATENT DIRICHLET ALLOCATION (2003)
IMPLEMENTED BY CHANG-UK, PARK
DATA FORMAT: "DocID\t WordID\t FREQUENCY\n"
"""
import sys
import random
@rutsky
rutsky / docker_gcc-4.9.md
Created May 8, 2014 21:19
GCC 4.9 installation in Docker container
$ sudo docker pull ubuntu
$ sudo docker  run -t -i ubuntu:14.04 /bin/bash
root@856b6aa801af:/# apt-get update
Ign http://archive.ubuntu.com trusty InRelease
Ign http://archive.ubuntu.com trusty-updates InRelease
Ign http://archive.ubuntu.com trusty-security InRelease
Get:1 http://archive.ubuntu.com trusty Release.gpg [933 B]
Get:2 http://archive.ubuntu.com trusty-updates Release.gpg [933 B]
Get:3 http://archive.ubuntu.com trusty-security Release.gpg [933 B]
@hayajo
hayajo / main.go
Created May 7, 2014 06:22
golangでsingleton
package main
import "sync"
type MySingleton struct {
}
var ch = make(chan bool, 1)
var s *MySingleton = nil
@timhughes
timhughes / git-unsorted-log.go
Last active April 28, 2017 09:51
An example of howto user git2go https://github.com/libgit2/git2go which is a libgit2 bindings package for golang
/*
requires libgit2
*/
package main
import (
@demisx
demisx / angularjs-providers-explained.md
Last active March 17, 2024 11:09
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@stevenyap
stevenyap / Capistrano 3.md
Created February 21, 2014 08:52
Capistrano 3 Setup

This guide explains the way to setup a production server using Capistrano.

Setup Capistrano on LOCAL

  • Capistrano is a development gem which assist the developer to run commands on the production server (something like a Heroku toolbelt)
  • Hence, it is installed and configured on developer's computer
# Gemfile

# Use Capistrano for deployment