Skip to content

Instantly share code, notes, and snippets.

View jasondown's full-sized avatar

Jason Down jasondown

View GitHub Profile
@ThePlenkov
ThePlenkov / boot.sh
Last active May 7, 2024 16:39
Resolve WSL DNS automatically
#!/bin/bash
# Remove existing "nameserver" lines from /etc/resolv.conf
sed -i '/nameserver/d' /etc/resolv.conf
# Run the PowerShell command to generate "nameserver" lines and append to /etc/resolv.conf
# we use full path here to support boot command with root user
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command '(Get-DnsClientServerAddress -AddressFamily IPv4).ServerAddresses | ForEach-Object { "nameserver $_" }' | tr -d '\r'| tee -a /etc/resolv.conf > /dev/null
#r "nuget: FSToolkit.ErrorHandling.TaskResult"
#r "nuget: FSharp.Json"
#r "nuget: Microsoft.Azure.Cosmos"
open System
open System.Text.RegularExpressions
open FsToolkit.ErrorHandling
open FSharp.Json
// Primitives
@akhansari
akhansari / flurl.fsx
Created March 15, 2021 14:54
F# Flurl
#r "nuget: Flurl.Http"
module HttpApi =
open System
open System.Net
open System.Text.Json
open Flurl.Http
type Serializer (opt) =
interface Configuration.ISerializer with
@dogeared
dogeared / 00_README
Last active November 24, 2020 23:47 — forked from lmarkus/README.MD
Extracting / Exporting custom emoji from Slack
This builds off the excellent work of @lmarkus.
The scripts below can be used in conjunction with the Slack Emoji Tools Google Chrome extension to export emojis from
one Slack team and import into another team.
Original work here: https://gist.github.com/lmarkus/8722f56baf8c47045621
@jasondown
jasondown / factorial_elixir.ex
Created September 2, 2016 04:29
Elixir Factorial - Pattern Matching and Recursion
defmodule MyMath do
def factorial(n), do: factorial(n, 1)
def factorial(0, acc), do: acc
def factorial(n, acc) do
factorial(n - 1, acc * n)
end
anonymous
anonymous / factorial_fsharp.fsx
Created September 2, 2016 04:09
F# Factorial - Pattern Matching and Recursion
let factorial n =
let rec factorial' n acc =
match n with
| 0 -> acc
| _ -> factorial' (n - 1) (acc * n)
factorial' n 1
@bishboria
bishboria / springer-free-maths-books.md
Last active April 25, 2024 06:27
Springer made a bunch of books available for free, these were the direct links
@Chaser324
Chaser324 / GitHub-Forking.md
Last active May 2, 2024 05:49
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream