Skip to content

Instantly share code, notes, and snippets.

View nimzo6689's full-sized avatar

nimzo6689 nimzo6689

View GitHub Profile
@nimzo6689
nimzo6689 / for_MariaDB.sql
Last active May 8, 2021 03:05
FizzBuzz without CASE clause
WITH RECURSIVE
-- どの倍数でどのワードに置き換えるかを定義
fizzbuzz(multiple, word) AS (
SELECT 3, 'fizz' UNION ALL SELECT 5, 'buzz'
),
-- 3 or 5 の倍数であれば fizz と buzz にそれぞれ置き換える。
results(seq_no, might_be_replaced, multiple_opt) AS (
SELECT 1, CAST(1 AS CHAR(256)), 0
UNION
SELECT seq_no + 1, COALESCE(word, seq_no + 1), multiple
# If you have not yet installed HtmlAgilityPack(HAP), try to run these commands.
#
# Register-PackageSource -Name Nuget -Location "http://www.nuget.org/api/v2" –ProviderName Nuget -Trusted
# Install-Package HtmlAgilityPack -RequiredVersion 1.11.20 -Scope CurrentUser -SkipDependencies
Add-Type -AssemblyName "$env:LOCALAPPDATA\PackageManagement\NuGet\Packages\HtmlAgilityPack.1.11.20\lib\netstandard2.0\HtmlAgilityPack.dll"
# If your XPath does not work, and it contains tbody or something like that, remove these tags, because web brawzer automatically added.
# 時刻表ページから平日・土日祝で運航されるタイムラインIDを取得する。
@nimzo6689
nimzo6689 / products.csv
Created December 6, 2019 12:54
Qiitaのサンプル用csvファイル
product_code product_name price
POSH00001 鉛筆 100
POSH00002 消しゴム 50
POSH00003 ノート 110
POSH00004 定規 90
POSH00005 蛍光ペン 70
@nimzo6689
nimzo6689 / .gitconfig
Last active December 5, 2019 01:15
ConEmu
[core]
autoCRLF = false
editor = code --wait
pager = less -m
[alias]
st = status
stt = status
difff = diff
cm = commit
graph = log --graph --date=short --decorate=short --pretty=format:'%Cgreen%h %Creset%cd %Cblue%cn %Cred%d %Creset%s'
@nimzo6689
nimzo6689 / Profile.ps1
Last active July 4, 2022 08:56
Windows10用の環境構築時のコマンドまとめ
# -- Modules --------------------------------------------------
Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Agnoster
Import-Module DockerCompletion
Import-Module scoop-completion
Import-Module PSColor
# ZLocation alternates your prompt function to track the location.
# If you have a custom prompt function in $profile, you should place Import-Module ZLocation after the prompt customization.
package com.qiita.nimzo6689.snippet.qrgen.schema;
import net.glxn.qrgen.core.scheme.EMail;
import net.glxn.qrgen.javase.QRCode;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
@nimzo6689
nimzo6689 / setup.ps1
Created February 7, 2019 21:18
Scoop+VSCode+PHPでの環境構築用PowerShell関数
# https://qiita.com/nimzo6689/items/e3ae6280f34539bb8680 用です。
function replaceFileContentWithoutBOM($path, $regex, $replacement) {
Get-Content -Encoding UTF8 $path `
| % {$_ -replace $regex, $replacement}`
| Out-String `
| % { [Text.Encoding]::UTF8.GetBytes($_) } `
| Set-Content -Path $path -Encoding Byte
}
@nimzo6689
nimzo6689 / setup.ps1
Last active January 11, 2019 06:54
Scoop + VS CodeでPHPのデバッグ環境を構築する手順
# 参考
# https://www.peyarogu.com/entry/php_xampp_vscode
# Scoop, VS Codeはインストール済みを想定
scoop php php-xdebug apache composer
@'
{
"require": {
@nimzo6689
nimzo6689 / setup.ps1
Last active January 4, 2019 08:12
PowerShellでGoogleAppsScriptの環境構築する方法
# Scoopの環境構築
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
scoop install git
# CUIツールをインストール
scoop install nodejs-lts yarn
# GUIツールをインストール
scoop bucket add extras
@nimzo6689
nimzo6689 / sonarqube_xpath.js
Created December 9, 2018 10:07
日常で書いたXPath式をとにかく保存しまくるページ
Array.from($x('//*[@id="root"]/div/div/nav/ul/li/a[./h3[contains(text(), "conditional")]]/@href'))
.map(e => `${e.textContent}, title: ${e.ownerElement.textContent}`)