Skip to content

Instantly share code, notes, and snippets.

View kimihito's full-sized avatar
🏠
Working from home

kimihito kimihito

🏠
Working from home
View GitHub Profile
@juno
juno / system_test_driven_by_headless_chrome.rb
Created November 13, 2017 12:39
Rails 5.1 System Test driven by headless chrome.
driven_by(
:selenium,
using: :chrome,
screen_size: [1400, 900],
options: {
desired_capabilities: {
chromeOptions: {
args: %w[headless disable-gpu],
prefs: {
'modifyheaders.headers.name' => 'Accept-Language',
@k0ta0uchi
k0ta0uchi / Mastodon_v2.2.0.txt
Created January 29, 2018 10:48
Mastodon v2.2.0の翻訳
新機能:
改良されたEメールダイジェスト機能 (#6252)
Eメールダイジェスト機能は長い間存在していましたが、自動化されておらず、機能させるには手動でタスクを走らせる必要がありました。 多くの管理者たちは機能させるためのcronjobを設定しておらず、この機能は実際には広く使われていません。ダイジェストとは?ダイジェストは20日間非アクティブの状態で、ユーザーがその期間にメンションされた場合のみ送信されます。ダイジェストはユーザーが受信したメンションを要約してくれます。
ダイジェストがSidekiqの一部として送られるようになり、cronjobの設定は必要なくなりました。なお、ダイジェストEメールは古いプレーンテキストのものから、かわいいHTMLバージョンになりました。
全てのEメールにHTML Eメールテンプレート (#6256, #6263, #6272, #6301)
Mastodon内の全てのシステムEメールが改訂され、明瞭性とフレーズが改良されました。 デザインはレスポンシブになり、様々なEメールクライアントでテストされています。
@marckohlbrugge
marckohlbrugge / wip_graphql_demo.rb
Last active October 10, 2022 11:46
Ruby example of creating a todo and then completing it using wip.co graphql.
# NOTE: Be sure to set the API key further down in the code!
require "net/http"
require "uri"
require "json"
class WIP
def initialize(api_key:)
@api_key = api_key
end
@turekj
turekj / jscpd.rb
Created June 17, 2018 08:12
Danger script for JSCPD integration
def find_duplicates
`jscpd`
unless File.exists?('jscpd_report.json')
puts "jscpd_report.json was not generated..."
return
end
jscpd_report = JSON.parse(File.read('jscpd_report.json'))
jscpd_clones = jscpd_report["statistics"]["clones"]
@hopsoft
hopsoft / prefetch.js
Last active March 4, 2025 02:01
Turbolinks Prefetching
const hoverTime = 400
const fetchers = {}
const doc = document.implementation.createHTMLDocument('prefetch')
function fetchPage (url, success) {
const xhr = new XMLHttpRequest()
xhr.open('GET', url)
xhr.setRequestHeader('VND.PREFETCH', 'true')
xhr.setRequestHeader('Accept', 'text/html')
xhr.onreadystatechange = () => {
@fortune
fortune / README.md
Last active October 6, 2023 07:51
Python ロギング方法
@davipatti
davipatti / thinkpad-setup.md
Last active December 17, 2019 01:14
ThinkPad Ubuntu setup

ThinkPad setup

Notes from installing Ubuntu 18.04 on a Lenovo ThinkPad X1 Extreme, with nvidia graphics.

  • Turn off secure boot in the BIOS.

Installer freezing / non-responsive

@tbutts
tbutts / tmux-migrate-options.py
Last active May 7, 2025 15:12
For tmux configs: Merge deprecated/removed -fg, -bg, and -attr options into the -style option
#!/usr/bin/env python
# vim: set fileencoding=utf-8
#
# USAGE:
# Back up your tmux old config, run the script and redirect stdout to your conf
# file. Example:
#
# $ cp ~/.tmux.conf ~/.tmux.conf.orig
# $ python ./tmux-migrate-options.py ~/.tmux.conf.orig > ~/.tmux.conf
#
@munierujp
munierujp / echo_middleware_firebase_authentication.go
Last active August 14, 2024 04:19
Echo's middleware for Firebase Authentication
package middleware
import (
"context"
"strings"
"github.com/labstack/echo/v4"
firebase "firebase.google.com/go"
"google.golang.org/api/option"
@lazaronixon
lazaronixon / _form.html.erb
Last active June 6, 2025 19:24
Dropzone.js + Stimulus + Active Storage + CSS Zero (2025)
<%= form_with(model: billboard) do |form| %>
<%= tag.div class: "dropzone", data: { controller: "dropzone", dropzone_param_name_value: "billboard[images][]", dropzone_url_value: rails_direct_uploads_url, dropzone_accepted_files_value: "image/*", dropzone_max_files_value: 3, dropzone_max_filesize_value: 0.300 } do %>
<div class="dz-default dz-message flex flex-col items-center">
<%= image_tag "upload.svg", size: 28, class: "colorize-black", aria: { hidden: true } %>
<h5 class="font-semibold mbs-4">Drop files here or click to upload.</h5>
<p class="text-sm text-subtle">Upload up to 10 files.</p>
</div>
<% end %>
<div class="inline-flex items-center mbs-2 mie-1">