Skip to content

Instantly share code, notes, and snippets.

View htsign's full-sized avatar
🤔

htsign htsign

🤔
View GitHub Profile
@kkrypt0nn
kkrypt0nn / ansi-colors-discord.md
Last active July 13, 2025 01:20
A guide to ANSI on Discord

A guide to ANSI on Discord

Discord is now slowly rolling out the ability to send colored messages within code blocks. It uses the ANSI color codes, so if you've tried to print colored text in your terminal or console with Python or other languages then it will be easy for you.

Quick Explanation

To be able to send a colored text, you need to use the ansi language for your code block and provide a prefix of this format before writing your text:

\u001b[{format};{color}m
@tyru
tyru / list-func.vim
Last active March 3, 2020 05:57
fold() and flatmap() implementation in Vim script
function! s:fold(list, f, init) abort
let ref = {'result': a:init}
return map(copy(a:list), {_,v -> extend(ref, {'result': a:f(ref.result, v)})})[-1].result
endfunction
function! s:fold2(list, f, init) abort
let l = a:list + [a:init]
let end = len(a:list)
return map(l, {i,v -> i is# end ? l[i-1] : a:f(l[i-1], v)})[-1]
endfunction
@melpon
melpon / wandbox-sponsors.md
Last active March 2, 2022 05:31
Wandboxのスポンサー募集(締め切りました)

スポンサーの募集は締め切りました。以後は GitHub Sponsors に移行する予定です。

どのような募集をしていたか知りたい場合は履歴を確認してください。

@sardell
sardell / flatten.js
Created August 1, 2016 19:33
Flatten Nested Array with ES2015
// This example uses ES2015 features. Use Babel to compile down to JS, or see the example at http://codepen.io/sardell/pen/VjGYRz
// example array provided
var example = [[1,2,[3]],4];
function flatten_array(nested) {
// concatenate using the spread operator
const flat = [].concat(...nested)
// repeat flatten_array function until nested array is flat
return flat.some(Array.isArray) ? flatten_array(flat) : flat;
@jfmengels
jfmengels / lodash-fp-documentation.md
Last active January 15, 2025 00:34
Generated docs for Lodash/fp. Help make them better at https://github.com/jfmengels/lodash-fp-docs
@t-nissie
t-nissie / 00OCaml.md
Last active November 16, 2024 06:46
OCaml練習帳

OCaml練習帳

OCamlを自習する。 浅井健一著『プログラミングの基礎』とそのWebサイト http://pllab.is.ocha.ac.jp/~asai/book-mov/ を使う。

インストール

UTF-8で漢字の入出力に対応させるのがわりと面倒。

Ubuntu 14.04 LTSへのインストール

UbuntuなどDebian系のGNU/Linuxにはapt-getで簡単にインストールできる:

@sgur
sgur / HowToUseFishOnMsys2.md
Last active April 10, 2018 12:16
MSYS2で fish を動作するようにするまで

1. msys2 で fish のインストール

pacman -S fish
pacman -S man

2. /usr/etc/fish/config.fish の編集

if status --is-login の条件内に以下のコードを追加 (/etc/profile と同様にパスを設定) する。

@sgur
sgur / corvusskk-egg-like-symbols-map.txt
Last active December 13, 2022 23:49
Corvus SKK のローマ字・かな変換テーブルにEGGライク(SKKFEP同等)な記号入力を追加 (日本語配列用)
a あ ア ア 0
i い イ イ 0
u う ウ ウ 0
e え エ エ 0
o お オ オ 0
ka か カ カ 0
ki き キ キ 0
ku く ク ク 0
ke け ケ ケ 0
ko こ コ コ 0
@voluntas
voluntas / webrtc.rst
Last active July 14, 2025 04:05
WebRTC コトハジメ
@walkure
walkure / HTTProxy.cs
Created September 12, 2015 13:00
HttpListenerを使ってFiddlerCoreを代替してみた http://www2.hatenadiary.jp/entry/2015/09/12/220008
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Net;
using System.IO;
using System.Threading;
namespace KCB2