Skip to content

Instantly share code, notes, and snippets.

[applications_to_ignore]
z
atom
aws
wireshark
photoshop
illustrator
lightroom
messages
@saboyutaka
saboyutaka / .rubocop.yml
Created July 11, 2023 23:30
.rubocop.yml
inherit_from: .rubocop_todo.yml
AllCops:
TargetRubyVersion: 2.7
DisplayCopNames: true
NewCops: enable
Exclude:
- 'db/seeds/*'
- 'db/**/*'
- 'vendor/**/*'
@saboyutaka
saboyutaka / wpapi.ts
Created September 14, 2021 13:40
wpapi
import WPAPI from "wpapi";
import { WP_REST_API_Posts } from "wp-types";
const wp = new WPAPI({ endpoint: "https://your.wordpress.com/wp-json" });
async function main() {
const posts: WP_REST_API_Posts = await wp.posts().get();
const contents = posts.map(p => p.content.rendered)
@saboyutaka
saboyutaka / firebase.ts
Last active February 27, 2021 07:42
Decode Firebase Authentication JWT Token
export type firebasePublicKeys = {
[key: string]: string | undefined;
};
type JwtHeader = {
alg?: string | undefined;
kid?: string | undefined;
typ?: string | undefined;
};
@saboyutaka
saboyutaka / lib.js
Created June 29, 2020 03:03
Nuxt helper
# lib/helpers.js
module.exports = {
appName: () => {
return process.env.APP_NAME;
},
};
@saboyutaka
saboyutaka / timer.vue
Created June 10, 2020 00:54
timer.vue
<script>
export default {
data() {
return {
timerId: "",
hour: "",
minutes: "",
second: "",
enteredTime: "",
};
@saboyutaka
saboyutaka / answer.rb
Last active November 1, 2019 12:27
RubyからSQLを実行する課題の答え
require 'pg'
# macの方 userを自分の名前(whoamiで出た名前)に変更する
client = PG::connect(
:host => "localhost",
:user => 'xxxxxxxxxx',
:password => '',
:dbname => "myapp")
# Windowsの方
@saboyutaka
saboyutaka / Brewfile
Last active July 16, 2023 13:06
Brewfile 2023.7
cask_args appdir: '/Applications'
tap 'caskroom/cask'
# tap 'homebrew/php'
brew 'azure-cli'
brew 'ctop'
brew 'curl'
brew 'ghq'
brew 'gist'
brew 'git'
@saboyutaka
saboyutaka / custom.xml
Created November 15, 2018 02:14
PhpStorm2018.2 keymaps
<keymap version="1" name="custom" parent="Mac OS X 10.5+">
<action id="$Redo">
<keyboard-shortcut first-keystroke="shift meta z" />
</action>
<action id="ActivateDatabaseToolWindow">
<keyboard-shortcut first-keystroke="ctrl g" second-keystroke="ctrl d" />
<keyboard-shortcut first-keystroke="meta 0" />
</action>
<action id="ActivateRoutesToolWindow">
<keyboard-shortcut first-keystroke="ctrl g" second-keystroke="r" />
#!/usr/bin/env /Users/yutaka/.rbenv/shims/ruby
ENV['PATH'] += ':/usr/local/bin'
require 'capybara/poltergeist'
require 'date'
require 'open3'
require 'dotenv'
Dotenv.load File.expand_path('../.env', __FILE__)
puts ':tennis:'