Skip to content

Instantly share code, notes, and snippets.

View devlights's full-sized avatar
🤧
hay fever....

devlights devlights

🤧
hay fever....
View GitHub Profile
@devlights
devlights / howto_use_scoop.md
Created August 29, 2023 08:01
Scoop 使い方まとめ

Scoop の使い方まとめ

インストール

$ scoop install xxxxx

アンインストール

@devlights
devlights / README.md
Last active August 23, 2023 08:04
バイトスライスに文字列を速く設定する方法(fmt.Sprintf, fmt.Appendf, 直接append使用)
@devlights
devlights / README.md
Last active July 22, 2023 16:07
ChromebookのLinuxにFlutterをインストール (ARM版) (結局Androidの設定はうまくいかず・・・)

Google Chrome は、ARM版を配布していないので、Chromiumで代用。

$ uname -m
aarch64

$ cd $HOME

$ sudo apt install clang cmake ninja-build pkg-config libgtk-3-dev build-essential chromium
$ git clone https://github.com/flutter/flutter.git -b stable
@devlights
devlights / hello-apple.md
Created July 1, 2022 10:03 — forked from Linrstudio/hello-apple.md
solutions for window.innerWidth / innerHeight issue in iOS9

iOS9 returns double the value for window.innerWidth & window.innerHeight
The versions that are concerned are: 9.0.0, 9.0.1, 9.0.2

A few people got mad on twitter:

window.innerWidth in iOS 9 Safari returns double the number it did in iOS 8? Is this real life? tell me no — @rachsmithtweets
iOS9 Safari has the most insane bug where window.innerWidth / innerHeight is *sometimes* twice as large as it should be. ughhhh. !? — @mattdesl

iOS9 innerWidth/innerHeight is having a lot of fun these days — @ayamflow

@devlights
devlights / kata.cs
Last active March 3, 2022 08:19
自分用 手慣らしの型 (go, csharp)
//
// 自分用の手慣らしの型
// 1.HttpClientでリクエストを出す(リクエストもそれぞれを非同期実行)
// 2.(1)の結果から <title> タグの中身を抽出
// 3.(2)の結果を出力
//
// エラー処理は面倒なので割愛している
//
// httpリクエストを非同期実行しているので
// 結果は毎回異なる可能性がある。
@devlights
devlights / Microsoft.PowerShell_profile.ps1
Last active February 8, 2022 04:52
PowerShell Profile
# ---------------------------------------------------
# Set encodings
# ---------------------------------------------------
[System.Console]::OutputEncoding = [System.Text.Encoding]::GetEncoding("utf-8")
[System.Console]::InputEncoding = [System.Text.Encoding]::GetEncoding("utf-8")
$env:LESSCHARSET = "utf-8"
# ---------------------------------------------------
# Import plugins
# - Enabling it slows down the startup time, so I've disabled it for now.
@devlights
devlights / 01-scoop.txt
Last active February 14, 2022 04:17
Scoop install list
$ scoop bucket add extras
$ scoop bucket add java
$ scoop bucket add iyokan-jp https://github.com/tetradice/scoop-iyokan-jp
$ scoop bucket add jfut https://github.com/jfut/scoop-jfut.git
$ scoop install 7zip
$ scoop install everything
$ scoop install git
$ scoop install go
$ scoop install googlechrome
@devlights
devlights / usegeneric1.go
Last active February 20, 2022 06:02
Go1.18 Generic examples
package main
import "fmt"
// https://go.dev/doc/tutorial/generics
func main() {
var (
ints = []int64{1, 2, 3, 4, 5}
floats = []float64{1.1, 1.2, 1.3, 1.4, 1.5}
)
@devlights
devlights / Dockerfile.golang
Last active January 19, 2022 06:35
My Dockerfiles
# syntax=docker/dockerfile:1-labs
FROM golang:rc-bullseye
#---------------------------------------------
# BUILD ARGUMENTS
#---------------------------------------------
ARG UID=1000
ARG GID=1000
ARG USERNAME=dev
ARG USERPASSWD=dev
@devlights
devlights / bitflags.go
Last active December 29, 2021 04:37
Go (Golang) Producer, Consumer, Goroutine, BitFlags
package main
import (
"context"
"log"
"math/rand"
"time"
)
// ---------------------------------------