Skip to content

Instantly share code, notes, and snippets.

View emanon001's full-sized avatar

emanon001 emanon001

View GitHub Profile
@bouzuya
bouzuya / wip-pr
Created April 5, 2014 06:49
Backlog + git-flow + WIP PRな運用でdevelopブランチからWIP PR投げるまでを処理するスクリプト
#!/bin/bash
# Description:
# Backlog + git-flow + WIP PR script
# Usage:
# wip-pr pj-123
#
# Requirement:
# use Mac OS X
@voluntas
voluntas / shiguredo.rst
Last active March 31, 2024 02:15
時雨堂コトハジメ

花火~ 最高な俺たちと糞コードの海

written by mizchi at 小物エンジニアの会.

最高の夏の花火について 花火

自己紹介

@kohyama
kohyama / str-drop-while-same.clj
Last active October 19, 2017 08:55
文字列を先頭から見て同じところまで除去 in Clojure
(require '[clojure.test :refer (with-test are run-tests)])
(with-test
(defn str-drop-while-same [& args]
(if (some nil? args) args
(->> (map #(concat % (repeat nil)) args)
(apply map vector)
(drop-while #(apply = %))
(take-while #(some identity %))
(apply map str))))
@mochiz
mochiz / gist:4736183
Last active April 16, 2023 03:56
rbenvとruby-buildでRuby環境を最新に保つ

rbenvとruby-buildでRuby環境を最新に保つ

更新日:2014/11/19

rbenv, ruby-buildを更新

$ cd ~/.rbenv
$ git pull origin master
$ cd ~/.rbenv/plugins/ruby-build
$ git pull origin master
(use 'clojure.test)
(with-test
(defn f
[& {:as options}]
options)
(is (nil? (f)))
(is (thrown? IllegalArgumentException (f nil)))
(is (thrown? IllegalArgumentException (f :a)))
(is (= (f nil nil) {nil nil}))
@plaster
plaster / memotest.clj
Last active December 10, 2015 22:38
メモ化再帰実験
(defn fib [n]
(let [a-fib (atom false)]
(reset! a-fib (memoize (fn [n] (if (< 1 n) (+ (@a-fib (- n 1)) (@a-fib (- n 2))) 1))))
(@a-fib n)
))
;;; inspired by @tnoda
(def ^:dynamic *m-fib*)
(defn fibv [n]
(binding [*m-fib* (memoize (fn [x] (if (< 1 x) (+ (*m-fib* (- x 1)) (*m-fib* (- x 2))) 1)))]
@akiatoji
akiatoji / _sns_description
Last active January 15, 2020 02:30
AWS SNS Sample code.
Notes on how to use AWS SNS:
1. Subscribe an HTTP endpoint (i.e. http://myhost/sns_endpoint) on AWS Console
2. AWS will send subscription confirmation right away
3. SNS_controller responds to subscription confirmation by sending confirmation using Fog.
4. Once AWS is happy, you can start sending notifications to your end point via SNS.
@plaster
plaster / pe-9.clj
Created December 15, 2012 07:21
Project Euler Problem 9 solution in Clojure (#mitori_clj)
(use 'clojure.test)
;; ピタゴラス数チェック
(defn pythagorean?
[a b c]
(= (* c c) (+ (* a a) (* b b))))
(is (pythagorean? 3 4 5))
;; 合計が a+b+c かつ 0 < a < b < c になるような組の列挙
@ponkore
ponkore / problem-4-1.clj
Created December 14, 2012 13:35
Project Euler Problem 4
;;;A palindromic number reads the same both ways.
;;;The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99.
;;;Find the largest palindrome made from the product of two 3-digit numbers.
;;;左右どちらから読んでも同じ値になる数を回文数という。 2桁の数の積で表される回文数のうち、
;;;最大のものは 9009 = 91 × 99 である。
;;;では、3桁の数の積で表される回文数のうち最大のものはいくらになるか。
(ns projecteuler.problem-4
(:require [clojure.string :as str])