Skip to content

Instantly share code, notes, and snippets.

View kdeenanauth's full-sized avatar

Kevin Deenanauth kdeenanauth

View GitHub Profile
@davidfowl
davidfowl / MinimalAPIs.md
Last active June 28, 2024 17:42
Minimal APIs at a glance
@danielrw7
danielrw7 / replify
Last active October 24, 2023 12:03
replify - Create a REPL for any command
#!/bin/sh
command="${*}"
printf "Initialized REPL for `%s`\n" "$command"
printf "%s> " "$command"
read -r input
while [ "$input" != "" ];
do
eval "$command $input"
printf "%s> " "$command"
@VonC
VonC / vendor.bat
Last active May 16, 2016 16:12
Windows bat script to vendorize a github repo in a vendor subfolder of a go project
@echo off
setlocal enabledelayedexpansion
rem set pkg=github.com/jroimartin/gocui
set pkg=%1
if "%pkg%"=="" (
echo expect package name github.com/user/project
exit /b 1
)
if exist "vendor/%pkg%" (
echo '%pkg%' already vendorized
text_file = sc.textFile("hdfs://sandbox.hortonworks.com/user/guest/install.log")
counts = text_file.flatMap( lambda line: line.split(" ")) \
.map(lambda word: (word, 1) ) \
.reduceByKey(lambda a, b : a + b)
counts.saveAsTextFile("hdfs://sandbox.hortonworks.com/user/guest/output1.txt")
@non
non / answer.md
Last active January 9, 2024 22:06
answer @nuttycom

What is the appeal of dynamically-typed languages?

Kris Nuttycombe asks:

I genuinely wish I understood the appeal of unityped languages better. Can someone who really knows both well-typed and unityped explain?

I think the terms well-typed and unityped are a bit of question-begging here (you might as well say good-typed versus bad-typed), so instead I will say statically-typed and dynamically-typed.

I'm going to approach this article using Scala to stand-in for static typing and Python for dynamic typing. I feel like I am credibly proficient both languages: I don't currently write a lot of Python, but I still have affection for the language, and have probably written hundreds of thousands of lines of Python code over the years.

@carols10cents
carols10cents / c#-to-rust.md
Last active April 18, 2024 22:55
C# to Rust Cheat Sheet

Thanks to @seejee for making this for me!!!

C# to Rust Cheat Sheet

The goal of this is to have an easily-scannable reference for the most common syntax idioms in C# and Rust so that programmers most comfortable with C# can quickly get through the syntax differences and feel like they could read and write basic Rust programs.

What do you think? Does this meet its goal? If not, why not?

Variables

@vaskoz
vaskoz / builder.go
Last active January 22, 2024 10:54
Golang Builder pattern
package main
import "strconv"
import "fmt"
type Color string
type Make string
type Model string
const (
@rocketraman
rocketraman / equals-hash-tostring.java
Last active April 27, 2023 04:53
Example of Guava-based equals, hashCode, toString implementations
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
public class Address {
...
@Override
public boolean equals(Object obj) {