Skip to content

Instantly share code, notes, and snippets.

View mununki's full-sized avatar
👨‍💻
Reasoning

woonki mununki

👨‍💻
Reasoning
View GitHub Profile
@namenu
namenu / 390.re
Last active November 3, 2020 15:22
Reason Dojo
let partition_by_identity = xs => {
let rec impl = (xs, cur) => {
switch (xs, cur) {
| ([], _) => [cur]
| ([x, ...xs], []) => impl(xs, [x])
| ([x, ...xs], [y, ..._]) =>
if (x == y) {
impl(xs, [x, ...cur]);
} else {
[cur, ...impl(xs, [x])];
@zehnpaard
zehnpaard / dune
Created June 10, 2019 09:31
OCaml template for menhir/ocamllex/dune indentation-aware parser
(menhir
(modules parser))
(ocamllex lexer)
(executable
(name ex))
@kneeprayer
kneeprayer / Replace-Content
Last active April 5, 2019 07:59
Replace all contents in the files in a specific recurse path.
#===============================================================================
# Replace-Content: 特定パス配下の全てのファイル内の指定文字列を置換する
# Param:
# $filePath : ファイルパス
# $replaceText1 : 置換対象文字列
# $replaceText2 : 置換後の文字列
#
# 使用例
# #sample.txtのファイル内の"AAA"という文字列を"BBB"に置換する
# Get-Content "C:\Work\*" "AAA" "BBB"
@kneeprayer
kneeprayer / Merge-Image.ps1
Last active April 5, 2019 07:59
Merge two Images in same folder
#
# Usage : .\Merge-Image.ps1 .\test*.png .\mergeImages\
#
$fileList = Get-ChildItem $args[0]
for ($i = 0; $i -lt $fileList.count; $i = $i + 2) {
# Add System.Drawing assembly
Add-Type -AssemblyName System.Drawing
$firstImage = [System.Drawing.Image]::FromFile((Get-Item $fileList[$i]))
if (($i + 1) -lt $fileList.count) {
@kneeprayer
kneeprayer / Invert-Image.ps1
Last active August 13, 2022 13:42
Invert Color Of An Image Using Powershell
#
# Usage : .\Invert-Image.ps1 .\test*.png
#
[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") | Out-Null
Get-ChildItem $args[0] | ForEach-Object {
$image = New-Object System.Drawing.Bitmap($_.fullname)
for ($y = 0; $y -lt $image.Height; $y++) {
for ($x = 0; $x -lt $image.Width; $x++) {
$pixelColor = $image.GetPixel($x, $y)
$varR = 255 - $pixelColor.R
@hjertnes
hjertnes / doom.txt
Created April 6, 2018 08:28
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
@eddiewebb
eddiewebb / readme.md
Last active October 24, 2024 06:51
Hugo JS Searching with Fuse.js
@busypeoples
busypeoples / PhantomTypeReasonML.md
Last active February 6, 2024 21:29
Phantom types in ReasonML

Phantom types in ReasonML

Introduction

"A phantom type is a parametrised type whose parameters do not all appear on the right-hand side of its definition..." Haskell Wiki, PhantomType

The following write-up is intended as an introduction into using phantom types in ReasonML.

Taking a look at the above definition from the Haskell wiki, it states that phantom types are parametrised types where not all parameters appear on the right-hand side. Let's try to see if we can implement a similar example as in said wiki.

@manasthakur
manasthakur / plugins.md
Last active June 2, 2024 07:29
Managing plugins in Vim

Managing plugins in Vim: The basics

Let's say the plugin is at a GitHub URL https://github.com/manasthakur/foo. First get the plugin by either cloning it (git clone https://github.com/manasthakur.foo.git) or simply downloading it as a zip (from its GitHub page).

Adding a plugin in Vim is equivalent to adding the plugin's code properly into its runtimepath (includes the $HOME/.vim directory by default). For example, if the layout of a plugin foo is as follows:

foo/autoload/foo.vim
foo/plugin/foo.vim
@henriquemenezes
henriquemenezes / android-generate-keystores.md
Last active November 6, 2024 04:47
Android: Generate Release/Debug Keystores

Android: Generate Release/Debug Keystores

Generate Keystores

Debug Keystore

$ keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "C=US, O=Android, CN=Android Debug"