Skip to content

Instantly share code, notes, and snippets.

Avatar

Ken Takagiwa giwa

View GitHub Profile
@kachayev
kachayev / concurrency-in-go.md
Last active Jun 23, 2020
Channels Are Not Enough or Why Pipelining Is Not That Easy
View concurrency-in-go.md
@shu0115
shu0115 / circle.yml
Created Jun 25, 2014
CircleCI on Heroku - 簡易自動デプロイ circle.ymlサンプル ref: http://qiita.com/shu_0115/items/496f3c46b09bbbba4d02
View circle.yml
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 Aug 7, 2020
The introduction to Reactive Programming you've been missing
View introrx.md
@ChangUk
ChangUk / GibbsLDA.py
Last active Jun 6, 2019
Collapsed Gibbs sampler for Latent Dirichlet Allocation
View GibbsLDA.py
#-*- 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
GCC 4.9 installation in Docker container
View docker_gcc-4.9.md
$ 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
golangでsingleton
View main.go
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 Apr 28, 2017
An example of howto user git2go https://github.com/libgit2/git2go which is a libgit2 bindings package for golang
View git-unsorted-log.go
/*
requires libgit2
*/
package main
import (
@demisx
demisx / angularjs-providers-explained.md
Last active Aug 7, 2020
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
View angularjs-providers-explained.md
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

View Capistrano 3.md

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
@atuttle
atuttle / api.js
Created Feb 4, 2014
Angular.js REST API Service Wrapper
View api.js
app.factory('API', function($http, $q){
var basePath = 'http://domain.com/api/path';
// => http://domain.com/api/path/foo/bar
function makeRequest(verb, uri, data){
var defer = $q.defer();
verb = verb.toLowerCase();
//start with the uri
You can’t perform that action at this time.