Skip to content

Instantly share code, notes, and snippets.

View letusfly85's full-sized avatar
🎯
Focusing

Shunsuke Wada letusfly85

🎯
Focusing
View GitHub Profile
@ito-mmj
ito-mmj / Main.kt
Created September 30, 2021 03:58
@file:JvmName("Main")
package pdfbox_sample
import org.apache.pdfbox.contentstream.operator.Operator
import org.apache.pdfbox.contentstream.operator.OperatorName
import org.apache.pdfbox.cos.COSArray
import org.apache.pdfbox.cos.COSName
import org.apache.pdfbox.cos.COSNumber
import org.apache.pdfbox.cos.COSString

GoLand備忘録 (Mac)

  • プロジェクト内のファイル内の文字列検索 cmd shift F
  • プロジェクト内のファイル名や型名などの検索 shift 連続2回
  • ファイル内のメソッドや関数検索 cmd fn F12
  • Projet に移動 cmd 1
    • ディレクトリ展開をすべて閉じる cmd -
    • ディレクトリ展開をすべて開く cmd +
    • Projet にフォーカス時、文字を打つだけでディレクトリやファイルを検索できる(展開して表示している場合のみ)
  • Docker に移動 cmd 8
@fredcamps
fredcamps / aliases.fish
Last active March 8, 2021 22:36
~/.config/fish/conf.d/
# aliases
alias omfrc="$EDITOR $HOME/.local/share/omf/init.fish"
alias terminalrc="$EDITOR $HOME/.config/xfce4/terminal/terminalrc"
alias esudo="sudo -e $EDITOR"
@whoisryosuke
whoisryosuke / nextjs-hoc-authorization.js
Created June 26, 2018 22:24
ReactJS - NextJS - A HOC for wrapping NextJS pages in an authentication check. Checks for getInitialProps on the child component and runs it, so you still get SSR from the page. Also includes a user agent for Material UI.
import React, {Component} from 'react'
import Router from 'next/router'
import AuthService from './AuthService'
export default function withAuth(AuthComponent) {
const Auth = new AuthService('http://localhost')
return class Authenticated extends Component {
static async getInitialProps(ctx) {
// Ensures material-ui renders the correct css prefixes server-side
@gakuzzzz
gakuzzzz / design_pattern_in_scala.md
Last active February 12, 2024 02:05
Design Patterns in Scala (ScalaMatsuri 2018 Unconfoerence)

Design Patterns in Scala

Scala でよく見るパターン

Type-Safe Builder

Javaで多引数のコンストラクタを避けるために使われる Builder パターンは、Scala では名前付き引数呼び出しが使えるので必要ありません。

Builderパターンに制約を加えて条件に合わない場合、コンパイルエラーにしたい。

@abalter
abalter / AnUpdate.md
Last active September 7, 2023 19:58
This is a simple wrapper for the `jupyter_client` that allows you to create a Jupyter kernel programmatically, execute code in it, and retrieve the output. It captures whatever would be sent to stdout, including errors. **UPDATE** [Better version here](https://github.com/abalter/polyglottus/blob/master/simple_kernel.py)
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/01_prepare_authorized_keys":
mode: "000777"
content: |
ARRAY=(
https://github.com/akehoyayoi.keys # アクセスできるようにしたいアカウントを列挙しておく
)
echo 'ssh-rsa 元々あったauthorized_keyを書いておく' > authorized_keys
for item in ${ARRAY[@]}; do
package main
import com.zaxxer.hikari.HikariDataSource
import org.apache.ibatis.annotations.Insert
import org.apache.ibatis.annotations.Select
import org.apache.ibatis.mapping.Environment
import org.apache.ibatis.session.Configuration
import org.apache.ibatis.session.SqlSession
import org.apache.ibatis.session.SqlSessionFactory
import org.apache.ibatis.session.SqlSessionFactoryBuilder
@MisaKondo
MisaKondo / gcp_2016_advent-calendar_1.md
Last active May 29, 2023 00:43
TerraformによるGCP環境の管理

この記事はGoogle Cloud Platform(1) Advent Calendar 2016の3日目となります!

Google Cloud Platform(以下、GCP)のサービスも一部はTokyoにようやくRegionが来たことだし、そろそろ利用してみたいと思った人も多いのではないでしょうか。 今回は、Google Compute Engine(以下、GCE)をTerraformを利用して構成管理をしてみます。

特に意味はないですが、気づいたら文字ばかりだったので、下記に今回利用するサービスのロゴを載せます。

GCP Terraform
gcp terraform