This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Hatena bookmark compatibility for InoReader | |
// @namespace https://htsign.hateblo.jp | |
// @version 0.4.0 | |
// @description add Hatebu images for InoReader | |
// @author htsign | |
// @match https://www.inoreader.com/* | |
// @match https://jp.inoreader.com/* | |
// @downloadURL https://gist.github.com/htsign/f32a273d50f0f62b7d220140c5722cad/raw/hatebu-for-inoreader.user.js | |
// @updateURL https://gist.github.com/htsign/f32a273d50f0f62b7d220140c5722cad/raw/hatebu-for-inoreader.user.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
abstract class ItemBase | |
{ | |
public abstract override string ToString(); | |
} | |
class IntItem : ItemBase | |
{ | |
private readonly int value; | |
public IntItem(int value) => this.value = value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const MyStorage = (() => { | |
const sym = Symbol(); | |
return class MyStorage { | |
constructor() { | |
if (arguments[0] !== sym) { | |
return new Proxy(new MyStorage(sym), { | |
get(target, prop) { | |
if (prop === 'length') return target.length; | |
const v = Reflect.get(target, prop); | |
return typeof v === 'function' ? v.bind(target) : target.getItem(prop); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set easymotion | |
set ideajoin | |
set surround | |
set commentary | |
set incsearch | |
nnoremap [c :action GotoNextError<CR> | |
nnoremap ]c :action GotoPreviousError<CR> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl https://sh.rustup.rs -sSf | sh -s -- --profile default | |
set -U fish_user_paths ~/.cargo/bin $fish_user_paths | |
rustup completions fish > ~/.config/fish/completions/rustup.fish | |
cargo install ripgrep | |
cargo install bat | |
cargo install exa | |
cargo install fd | |
sudo add-apt-repository ppa:longsleep/golang-backports | |
sudo apt update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
list(N, N, [N]). | |
list(S, E, L) :- | |
S < E, | |
succ(S, X), | |
list(X, E, L1), | |
L = [S | L1]. | |
list(S, E, L) :- | |
S > E, | |
succ(X, S), | |
list(X, E, L1), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iterator chunked*[T](xs: openArray[T], size: int, yieldRest = true): seq[T] = | |
var | |
i: int | |
let | |
last = xs.high | |
for j in countup(0, xs.len, size + 1): | |
i = j | |
if i + size > last: break | |
yield xs[i .. i + size] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Qiita tagfeed AutoMore | |
// @namespace https://htsign.hateblo.jp | |
// @version 0.3.2 | |
// @description auto fetch more entries | |
// @author htsign | |
// @include https://qiita.com/timeline* | |
// @updateURL https://gist.github.com/htsign/0635b47b1af1a4b51719f462b1550f0e/raw/qiitaTimelineAutoMore.user.js | |
// @downloadURL https://gist.github.com/htsign/0635b47b1af1a4b51719f462b1550f0e/raw/qiitaTimelineAutoMore.user.js | |
// @grant none |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc fizzBuzz(n: int) = | |
let (x, y) = (n mod 3, n mod 5) | |
let s = | |
if (x, y) == (0, 0): "FizzBuzz" | |
elif x == 0: "Fizz" | |
elif y == 0: "Buzz" | |
else: $n | |
echo s | |
for x in 1..100: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import strformat | |
template until(cond: bool, body: untyped): untyped = | |
while (true): | |
if cond: break | |
body | |
for param in os.commandLineParams(): | |
if os.existsFile(param): |