Skip to content

Instantly share code, notes, and snippets.

View niku's full-sized avatar
💭
🍖

KITAMURA Daisuke niku

💭
🍖
View GitHub Profile
@niku
niku / Gemfile
Last active April 15, 2019 09:51
"JavaScript-Free Soft-Realtime Browsing" at https://pixiv.connpass.com/event/124727/
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
# Specify your gem's dependencies in rejectkaigi2019lt.gemspec
gemspec
require "securerandom"
require "pg"
require "org-ruby"
require "unf"
module SaveLegacy
class Error < StandardError; end
db_setting = {
connect_timeout: 300,
9a10
> Agent.start_link(fn -> 0 end, name: Result)
11,15c12,13
< try do
< walk(maze, x, y, %{}, 0)
< catch
< pt -> pt
< end
---
> walk(maze, x, y, %{}, 0)
@niku
niku / ._This_is_a_Slack_RTM_API_example.md
Last active April 26, 2018 12:22
Slack RTM API sandbox with Elixir and gun

You can test this example easily.

git clone https://gist.github.com/niku/7bee3d72fd1fd442e6d115330bbd963b slack_rtm_api_sandbox
cd slack_rtm_api_sandbox
mix deps.get
mix run  --no-halt -e 'Supervisor.start_link([SlackRtmApiSandbox.child_spec({"YOUR_BOT_API_TOKEN", ""})], strategy: :one_for_one)'

Environment

% java -version
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)

% mvn --version
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T04:39:06+09:00)
@niku
niku / .travis.yml
Last active April 17, 2017 03:58
Elixir製のプロジェクトをTravisCIで運用するための.travis.yml ref: http://qiita.com/niku/items/9c205a9d84d4dd24ddfe
language: elixir
sudo: false
otp_release:
- 19.3
elixir:
- 1.4.2
env:
global:
- HEX_USERNAME=niku
# Follow other language's environment
@niku
niku / mix.exs
Created February 2, 2017 12:07
ecto_sandbox
defmodule EctoSandbox.Mixfile do
use Mix.Project
def project do
[app: :ecto_sandbox,
version: "0.1.0",
elixir: "~> 1.4",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
elixirc_paths: ["."],
@niku
niku / dialyxir_sandbox.ex
Last active January 23, 2017 04:21
Dialyzer sandbox
defmodule DialyxirSandbox do
# @spec hello() :: atom
@spec hello() :: String.t
def hello do
:world
end
end
@niku
niku / httpoison_sandbox.exs
Created January 18, 2017 13:50
HTTPoison sandbox
HTTPoison.start
result = HTTPoison.get! "http://example.com"
IO.inspect result
@niku
niku / _README.md
Last active December 15, 2016 12:07
FizzBuzz using GenStage

How To Use

% git clone https://gist.github.com/c7186587fd1090b47ba52d4d646737f7.git
% cd c7186587fd1090b47ba52d4d646737f7
% mix do deps.get, run fizzbuzz.exs
(...snip...)
{1, 1, NormalConsumer, #PID<0.464.0>}
{5, "buzz", BuzzConsumer, #PID<0.466.0>}
{3, "fizz", FizzConsumer, #PID&lt;0.465.0&gt;}