Skip to content

Instantly share code, notes, and snippets.

View tdkn's full-sized avatar
😎
Power 💪

Shun Tedokon tdkn

😎
Power 💪
View GitHub Profile
@tdkn
tdkn / uninstall-rubymine.md
Last active June 7, 2019 09:41
Uninstall RubyMine completely
$ rm -rf ~/Library/Caches/RubyMine*
$ rm -rf ~/Library/Application Support/RubyMine*
$ rm -rf ~/Library/Preferences/RubyMine*
$ rm -rf ~/Library/Preferences/com.jetbrains.rubymine.plist*
$ rm -rf ~/Library/Logs/RubyMine*
@tdkn
tdkn / module.js
Created April 19, 2019 04:38
Nuxt Hooks
export default function module() {
;[
'ready',
'error',
'close',
'listen',
'render:before',
'render:setupMiddleware',
'render:errorMiddleware',
'render:resourcesLoaded',
@tdkn
tdkn / gist:02db5ed4f55ed857fb40f139afe18f73
Created March 25, 2019 08:57
docker-sync dependencies
$ gem install docker-sync
Fetching: thor-0.20.3.gem (100%)
Successfully installed thor-0.20.3
Fetching: gem_update_checker-0.2.0.gem (100%)
Successfully installed gem_update_checker-0.2.0
Fetching: backticks-1.0.2.gem (100%)
Successfully installed backticks-1.0.2
Fetching: docker-compose-1.1.12.gem (100%)
Successfully installed docker-compose-1.1.12
Fetching: terminal-notifier-2.0.0.gem (100%)
@tdkn
tdkn / rails.new.txt
Created March 18, 2019 08:46
Rails new command options
Usage:
rails new APP_PATH [options]
Options:
[--skip-namespace], [--no-skip-namespace] # Skip namespace (affects only isolated applications)
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
-m, [--template=TEMPLATE] # Path to some application template (can be a filesystem path or URL)
-d, [--database=DATABASE] # Preconfigure for selected database (options: mysql/postgresql/sqlite3/oracle/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
# Default: sqlite3
@tdkn
tdkn / cards.json
Created January 20, 2019 16:49
Dominion Card List
[
{
"names": ["銅貨", "Copper"],
"pronunciations": ["どうか"],
"set": "基本",
"cost": {
"coin": "0",
"potion": null,
"debt": null
},
@tdkn
tdkn / TransformStringBooleans.php
Last active July 9, 2018 06:59
A Laravel middleware for transform String to Boolean
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\TransformsRequest;
class TransformStringBooleans extends TransformsRequest
{
/**
* Transform the given value.
@tdkn
tdkn / explode.php
Last active July 2, 2018 07:54
ドット区切りのソート用文字列をパースするやつ
$order = 'table_name.column.desc';
list($direction, $column) = array_map(
'strrev',
explode('.', strrev($order), 2)
);
echo $direction; // "desc"
echo $column; // "table_name.column"
@tdkn
tdkn / autolink.vue
Last active June 28, 2018 08:35
Vue.js auto-link directive for Tweet
@tdkn
tdkn / localhost
Created June 20, 2018 11:20
Ansible inventory for docker connection
[webservers]
localhost ansible_connection=docker ansible_host=ubuntu ansible_user=root
[mysqlservers]
localhost ansible_connection=docker ansible_host=ubuntu ansible_user=root
[queueservers]
localhost ansible_connection=docker ansible_host=ubuntu ansible_user=root
@tdkn
tdkn / merge.js
Created April 11, 2018 16:08
Merge complex array of object
[
{
data: [{ x: 1, y: 2 }, { x: 3, y: 4 }]
},
{
data: [{ x: 5, y: 6 }, { x: 7, y: 8 }]
}
].map(({ data }) => data).reduce((acc, cur, i, arr) => {
acc.push(cur.map(({x, y}) => ({ [`x${i}`]: x, [`y${i}`]: y })))
return acc