Skip to content

Instantly share code, notes, and snippets.

View Fubuchi's full-sized avatar

Hải Hoàng Fubuchi

  • Ho Chi Minh City, Vietnam
  • 06:27 (UTC +07:00)
View GitHub Profile
@bitwalker
bitwalker / Option.cs
Created July 11, 2014 20:32
Implementation of Option<T> in C#
using System;
namespace Types
{
public static class Option
{
public static Option<T> ToOption<T>(this T @this)
{
if (@this == null)
return Option<T>.None;
@eduardoleon
eduardoleon / PatMat.hs
Created December 17, 2014 11:02
Pattern matching vs. Visitor pattern
import Control.Applicative
data Person = Boy String
| Girl String
data Animal = Dog String
| Cat String
| Bug
boy (Dog n) = " plays with " ++ n
@mrange
mrange / why_fsharp.md
Last active May 7, 2021 13:51
Why F#?

Why F#?

I got inspired to answer the questions posed to F# experts on "Why F#?". I have no claims to be an F# expert but I thought the questions were interesting.

How and when did you get started programming in F#?

I believe I started to look at F# around 2008. I am a language-curious person and was at the time working as a .NET developer so I naturally was excited when discovering F#.

How long did it take before you could code real world apps as much or more productively as in C#?

@renaco
renaco / .gitconfig
Last active September 27, 2022 08:29
.gitconfig (Meld configuration on windows)
[merge]
tool = meld
[mergetool "meld"]
cmd = \"C:\\Program Files (x86)\\Meld\\Meld.exe\" "$LOCAL" "$BASE" "$REMOTE" "--output=$MERGED"
path = C:/Program Files (x86)/Meld/Meld.exe
trustExitCode = false
keepBackup = false
[diff]
tool = meld
NetLimiter 3
Registration name: Peter Raheli
Registration code: C99A2-QSSUD-2CSBG-TSRPN-A2BEB
NetLimiter 4
Registration Name: Vladimir Putin #2
Registration Code: XLEVD-PNASB-6A3BD-Z72GJ-SPAH7
https://www.netlimiter.com/download
# Netlimiter Full Netlimiter Activated Netlimiter cracked Netlimiter Full Version Netlimiter Serial Netlimiter keygen Netlimiter crack Netlimiter 4 serial Netlimiter 4 Crack Netlimiter 4 register Netlimiter 4 patch Netlimiter full Full version Netlimiter 4 Activated Netlimiter 4 Cracked Netlimiter Pro
@alexandreaquiles
alexandreaquiles / EscapeXmlELResolverListener.java
Last active May 7, 2020 07:19
EscapeXmlELResolverListener for Spring Boot based on pukkaone.github.io/2011/01/03/jsp-cross-site-scripting-elresolver.html
package br.com.caelum.fj91.seguranca;
import java.beans.FeatureDescriptor;
import java.util.Iterator;
import javax.el.ELContext;
import javax.el.ELResolver;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.jsp.JspContext;
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution
Last active July 3, 2024 20:33
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
@samba2
samba2 / vscode-java-formatter.md
Created December 25, 2019 10:13
Visual Studio Code Java - Method Chain Formatting

Issue

By default VS Code Java squeezes chained methods into one line. The goal is to have VS Code Java behave similary to IntelliJ: the second and following methods are properly indented but not pulled back to the line which started the method chain.

In short:

Is (not good)

@artman41
artman41 / wsl-install_another_distro.md
Last active July 11, 2024 15:56
Instructions on how to install a custom distro in WSL2 (Windows SubSystem for Linux 2)

WSL install another distro

  1. Here are some default vars for the process
ISO_DIR=~/fedora;
ROOTFS_MOUNT_DIR=/mnt/contents

DISTRO_LOCATION=
@OmegaRogue
OmegaRogue / Directory_Prompts_WT_Uninstall.reg
Last active June 24, 2024 10:52
Registry script to add windows terminal with cmd, powershell and ubuntu profiles to the explorer context menu with normal and admin permissions. To use, replace <Username> with your username
Windows Registry Editor Version 5.00
; Windows terminal
[-HKEY_CLASSES_ROOT\Directory\shell\MenuWindowsTerminal]
[-HKEY_CLASSES_ROOT\Directory\background\shell\MenuWindowsTerminal]
[-HKEY_CLASSES_ROOT\Directory\LibraryFolder\shell\MenuWindowsTerminal]