Skip to content

Instantly share code, notes, and snippets.

View ybiquitous's full-sized avatar
💬

Masafumi Koba ybiquitous

💬
View GitHub Profile
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active June 5, 2024 22:16
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@judy2k
judy2k / parse_dotenv.bash
Created March 22, 2017 13:34
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@oatmeaI
oatmeaI / goodcheck-en.yaml
Last active October 16, 2018 16:02
Example Goodcheck Rules
rules:
- id: com.sideci.js.localstorage
pattern:
token: localStorage
glob:
- "**/*.js"
- "**/*.jsx"
- "**/*.ts"
- "**/*.tsx"
message: |
(require 'lsp-mode)
(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection '("bundle" "exec" "steep" "langserver"))
:major-modes '(ruby-mode enh-ruby-mode)
:priority -2
:server-id 'steep-ls))
(add-hook 'ruby-mode-hook #'lsp)
@ybiquitous
ybiquitous / release.yml
Last active April 14, 2020 14:30
How to automate GitHub releases via GitHub Actions
name: Release
on:
push:
tags: ["**"]
jobs:
run:
runs-on: ubuntu-latest
steps:
@ybiquitous
ybiquitous / skip-ci-on-actions.yml
Last active February 9, 2021 10:11
How to "[skip ci]" on GitHub Actions
# See also:
# - https://github.com/actions/runner/issues/774
# - https://help.github.com/en/actions/reference/events-that-trigger-workflows#push-event-push
# - https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request
# - https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions
name: "[skip ci]" on Actions
on: [push, pull_request]

Rails.envを減らしたい

TL;DR

  • if Rails.env.production?をやめて、if ENV['ENABLE_HOGEHOGE_FEATURE']のように書いていこう

Kibelaの現状

Rails.envがたくさん生えています。

@ybiquitous
ybiquitous / secretlint.yml
Last active May 13, 2021 08:46
Secretlint out of the box via GitHub Actions
# https://github.com/secretlint/secretlint
name: secretlint
on:
push:
branches: ['main']
pull_request:
branches: ['**']
jobs:
@ybiquitous
ybiquitous / steep.yml
Last active August 6, 2021 21:27
Steep on GitHub Actions
# https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell
name: Steep
on: pull_request
jobs:
check:
runs-on: ubuntu-latest