Skip to content

Instantly share code, notes, and snippets.

View shtakai's full-sized avatar
🐤
I am leaning Ada.

Alyson shtakai

🐤
I am leaning Ada.
View GitHub Profile
@tomasr8
tomasr8 / redux.js
Created February 17, 2020 11:41
Redux in 30 lines
function createStore(reducer) {
const store = {
state: {},
reducer,
dispatch(action) {
this.state = this.reducer(action, this.state)
}
}
store.dispatch({})
source "https://rubygems.org"
# Fixed order
gem "rails"
# Alphabetical order
gem "activerecord-belongs_to_if"
gem "bcrypt"
gem "email_validator"
gem "execjs"
@nov
nov / line_login.rb
Last active November 24, 2017 10:07
LINE ID Login
require 'openid_connect'
OpenIDConnect.debug!
config = {
client_id: 'YOUR-CHANNEL-ID',
client_secret: 'YOUR-CHANNEL-SECRET'
}
client = OpenIDConnect::Client.new(
@yuroyoro
yuroyoro / development.js
Created February 15, 2017 02:16
webpakcer.gemにscssのビルドを加えて、大きめの依存ライブラリを別ファイルに分けて吐くようにしたwebpack.cnofig
// Note: You must restart bin/webpack-watcher for changes to take effect
var path = require('path')
var webpack = require('webpack')
var merge = require('webpack-merge')
var config = require('./shared.js')
var devconfig = {
devtool: 'sourcemap',
@kmjones1979
kmjones1979 / links.md
Last active March 27, 2017 04:23
ODW 2016 Webinar Links
@necojackarc
necojackarc / active_job_retry_controlable.rb
Last active June 30, 2021 13:20
To enable ActiveJob to control retry
module ActiveJobRetryControlable
extend ActiveSupport::Concern
DEFAULT_RETRY_LIMIT = 5
attr_reader :attempt_number
module ClassMethods
def retry_limit(retry_limit)
@retry_limit = retry_limit
@mbajur
mbajur / .md
Created April 29, 2016 07:16
How to create small, unique tokens in Ruby

How to create small, unique tokens in Ruby

That is is basically a "fork" of blog article i'm constantly returning to. It seems that the blog is down:

My choice: Dave Bass’s rand().to_s() trick

Dave Bass proposed this which I picked up for my implementation (here for an 8-chars token):

@voluntas
voluntas / realtime_movie_stream.rst
Last active August 5, 2024 09:58
リアルタイム動画配信コトハジメ
@abhinavmsra
abhinavmsra / money_best_practices.md
Last active November 12, 2023 13:00
Tips for Money Related Arithmetic in Ruby

Tips for Money Related Arithmetic in Ruby

  1. Never use float for performing arithmetic calculations relating to money.

    Floating numbers can sometimes show funky behaviour. It is not Ruby’s fault but the very implementation of floating numbers raises precision issues.

Examples of odd behaviour:

@koyhoge
koyhoge / gist:afe31518f63c16120f2d
Last active June 1, 2023 06:32
エンジニアのための法律勉強会#1『受託開発における契約時の注意事項』参加メモ

エンジニアのための法律勉強会#1『受託開発における契約時の注意事項』参加メモ

前提

  • システム開発そのものは素人だけど、裁判にはクライアント/開発側の両方で関わったことがある。
  • 裁判官はもっとシステム開発については分かってない。