Skip to content

Instantly share code, notes, and snippets.

View Jwata's full-sized avatar
🌴
On vacation

Junji Watanabe Jwata

🌴
On vacation
View GitHub Profile
SELECT t0.user_identifier     c0, 
       t0.id                  c1, 
       t0.login_id            c2, 
       t0.login_password      c3, 
       t0.model               c4, 
       t0.platform            c5, 
       t0.uuid                c6, 
       t0.handle_name         c7, 
       t0.email               c8, 
INSERT INTO user_login_history 
            ( 
                        remote_address, 
                        user_agent, 
                        latitude, 
                        longitude, 
                        login_at, 
                        user_identifier 
            ) 

myprofile_settings

SELECT t0.id               c0, 
       t0.first_name       c1, 
       t0.middle_name      c2, 
       t0.last_name        c3, 
       t0.gender           c4, 
       t0.birth_year       c5, 
       t0.job              c6, 
       t0.income           c7, 
#!/usr/local/var/rbenv/shims/ruby
@engine = Wongi::Engine.create
class Text
attr_accessor :length, :counts
def initialize
@length = 32
@counts = {
@Jwata
Jwata / delete_indices.sh
Last active May 13, 2016 02:12
delete all indices of local elasticsearch
for index in `curl -XGET http://localhost:9200/_settings?pretty | jq "keys[]" | sed -e 's/\"//g'`;do echo localhost:9200/$index ;done
#!/bin/sh
current_revision=`git rev-parse HEAD`
last_release=`git for-each-ref --sort=-taggerdate --format='%(tag)' refs/tags | head -n 1`
echo "the last release is version: ${last_release}"
compare_url=`hub compare -u ${last_release}%2E%2E%2E${current_revision}`
echo "Check the list in github: ${compare_url}"
echo "\n"
git log --reverse --pretty=format:"%h - %an, %ar : %s" ${last_release}...${current_revision}
test
```
brew tap cloudfoundry/tap
@Jwata
Jwata / README.md
Last active November 23, 2019 10:35
Calculate Rails CSRF token stored in session from authenticity token

On your rails project root

git clone https://gist.github.com/Jwata/4e5122fa43d719400914716955872cc2 authenticity_token_to_csrf_token

rails runner ./authenticity_token_to_csrf_token/calculate.rb 'some_authenticity_token'
=> 2PqIaqHja/+PllheC7mStH2X+y/E69LlyS5AIfd9MVs= # this is the csrf token stored in your session