Skip to content

Instantly share code, notes, and snippets.

View juno's full-sized avatar
💰
writing code (almost) every weekday

Junya Ogura juno

💰
writing code (almost) every weekday
View GitHub Profile
@mizchi
mizchi / how-hooks-work.md
Last active March 28, 2024 07:10
(翻訳) React Hooks は魔法ではなく、ただの配列だ

(翻訳) React Hooks は魔法ではなく、ただの配列だ

この記事は https://medium.com/@ryardley/react-hooks-not-magic-just-arrays-cd4f1857236e の日本語訳です。途中で力尽きて雑な翻訳になってる箇所がいくつかあります。


どのように Hooks が動いているか

私は、新しい Hooks の API の "magic" な挙動に悩んでいる人が結構いると聞いています。なのでこの構文の提案が、少なくとも表面的なレベルではどう動いているか、解説してみようと思います。

@knu
knu / system_spec_html_screenshot.rb
Created October 12, 2018 09:29
Enable HTML Source snapshot in RSpec's system specs
return unless Rails.env.test?
require 'highline'
require "action_dispatch/system_testing/test_helpers/screenshot_helper"
module ActionDispatch
module SystemTesting
module TestHelpers
module ScreenshotHelper
module HtmlSaver
@mtei
mtei / avr-compiler-install.md
Last active October 4, 2018 01:33
簡単な qmk_firmware のコンパイル環境の構築法 macOS (多分 Linux でも可能)

簡単な qmk_firmware のコンパイル環境の構築法 macOS

以下の説明は、Unix の shell の基本的な使い方を知っている人向け。

  1. https://www.arduino.cc/en/Main/Software で 「Mac OS X」をクリックして飛んだページで、「JUST DOWNLOAD」または「CONTRIBUTE & DOWNLOAD」をクリックして Mac版 ArduinoIDE をダウンロードしてインストールする。
  2. PATH 環境変数に以下のように追加する。
    PATH=~/bin:/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/:$PATH
    
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@voluntas
voluntas / working_time.rst
Last active February 13, 2024 15:22
時雨堂を支える固定時間労働 1 日 6 時間

時雨堂を支える固定時間労働 1 日 6 時間

更新

2024-01-20

作者

@voluntas

バージョン

2024.1

URL

https://voluntas.github.io/

概要

@kumpelblase2
kumpelblase2 / keybindings.txt
Created March 12, 2017 12:19
Vimium Dvorak Mappings
# Insert your preferred key mappings here.
unmapAll
# Basic movement
map d scrollLeft
map h scrollDown
map t scrollUp
map n scrollRight
map ii scrollToTop
map I scrollToBottom
@jnwheeler44
jnwheeler44 / circle.yml
Created December 29, 2016 19:34
How to use Postgres 9.6.1 on circleci 14.04 image
# Other settings have been omitted, the below changes are relevant
machine:
pre:
- sudo service postgresql stop
- sudo apt-get purge -y postgresql*
- sudo apt-get update
- sudo apt-get install postgresql
- sudo service postgresql start
- sudo su - postgres -c "echo \"create user ubuntu with password 'ubuntu';\" | psql"
- sudo su - postgres -c "echo \"alter user ubuntu with superuser;\" | psql"
@strzibny
strzibny / unused_routes.rb
Created May 5, 2016 15:21
Find unused routes in Rails
#!/usr/bin/env ruby
# Extracted from traceroute gem + checking the presence of views as well
require_relative './config/environment.rb'
class Traceroute
def initialize(app)
@app = app
end
@indiesquidge
indiesquidge / subdomain-localhost-rails-5.md
Created January 19, 2016 07:42
how to access subdomains locally with Rails 5

Subdomaining Localhost with Rails 5

I've been following this blog post on how to set up an api-only Rails 5 application. One of the sections talks about creating a subdomain for your api

Rails.application.routes.draw do
  constraints subdomain: "api" do
    scope module: "api" do
@ivanyv
ivanyv / application.amp.erb
Created December 12, 2015 02:51
Easy Google AMP on Rails
<html>
<head>
<link rel="canonical" href="<%= current_uri_sans_amp %>">
</head>
...
</html>