Skip to content

Instantly share code, notes, and snippets.

View dc0d's full-sized avatar
💭
Some Sketches ¯\_(ツ)_/¯

Kaveh Shahbazian dc0d

💭
Some Sketches ¯\_(ツ)_/¯
View GitHub Profile
@graninas
graninas / What_killed_Haskell_could_kill_Rust.md
Last active November 5, 2024 02:15
What killed Haskell, could kill Rust, too

At the beginning of 2030, I found this essay in my archives. From what I know today, I think it was very insightful at the moment of writing. And I feel it should be published because it can teach us, Rust developers, how to prevent that sad story from happening again.


What killed Haskell, could kill Rust, too

What killed Haskell, could kill Rust, too. Why would I even mention Haskell in this context? Well, Haskell and Rust are deeply related. Not because Rust is Haskell without HKTs. (Some of you know what that means, and the rest of you will wonder for a very long time). Much of the style of Rust is similar in many ways to the style of Haskell. In some sense Rust is a reincarnation of Haskell, with a little bit of C-ish like syntax, a very small amount.

Is Haskell dead?

@aymericbeaumet
aymericbeaumet / delete-likes-from-twitter.md
Last active November 12, 2024 13:33
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
@skyzyx
skyzyx / homebrew-gnubin.md
Last active November 9, 2024 06:16
Using GNU command line tools in macOS instead of FreeBSD tools

macOS is a Unix, and not built on Linux.

I think most of us realize that macOS isn't a Linux OS, but what that also means is that instead of shipping with the GNU flavor of command line tools, it ships with the FreeBSD flavor. As such, writing shell scripts which can work across both platforms can sometimes be challenging.

Homebrew

Homebrew can be used to install the GNU versions of tools onto your Mac, but they are all prefixed with "g" by default.

All commands have been installed with the prefix "g". If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH from your bashrc.

@ww9
ww9 / gist_blog.md
Last active November 2, 2024 14:04
Using Gist as a blog #blog

Blogging with Gist

Gist simplicity can turn blogging into a liberating experience.

Pros Cons
✅ Free, simple, fast, hassle-free ❌ Image upload in comments only
✅ Tagging ❌ No post pinning
✅ Search ❌ Doesn't look like a blog
✅ Revisions ❌ Unfriendly URLs
@tadasv
tadasv / orm.go
Last active February 14, 2022 19:19
Simple ORM for Golang
/*
This is an implementation of simple ORM that supports CRUD operations on single object, column mapping from struct tags.
example:
type Account struct {
orm.Model
UUID string
Name string
Email string
@rnwolf
rnwolf / spacemacs-keybindings.md
Last active October 28, 2024 02:30 — forked from kiambogo/spacemacs-keybindings
spacemacs keybindings that i need to learn
@bketelsen
bketelsen / gaweb.service
Created December 5, 2017 20:10
systemd unit file for a go web app
# /etc/systemd/system/gaweb.service
[Unit]
Description=gopheracademy website
[Service]
PIDFile=/tmp/gaweb.pid-3001
User=gaweb
Group=gaweb
Environment=GO_ENV=production
Environment=POSTGRES_PASSWORD=SomePassWord
@jdk
jdk / start_docker_registry.bash
Last active August 26, 2018 09:25 — forked from PieterScheffers/start_docker_registry.bash
Start docker registry with letsencrypt certificates (Linux Ubuntu)
#!/usr/bin/env bash
# install docker
# https://docs.docker.com/engine/installation/linux/ubuntulinux/
# install docker-compose
# https://docs.docker.com/compose/install/
# Make sure you have backports, add this to /etc/apt/source.list
# jesse-backports
@asukakenji
asukakenji / 0-go-os-arch.md
Last active November 6, 2024 03:19
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@crittermike
crittermike / wget.sh
Last active October 30, 2024 20:38
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.