Skip to content

Instantly share code, notes, and snippets.

View MattAlp's full-sized avatar
❄️

Matt MattAlp

❄️
View GitHub Profile
@ekzhang
ekzhang / Buildcarte.ipynb
Last active November 2, 2023 03:39
Build Systems à la Carte — Python edition
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

immutable = deeply frozen

Immutable classes

Immutable core classes

  • TrueClass
  • FalseClass
  • NilClass
  • Integer
@pmenke-de
pmenke-de / README.md
Last active January 25, 2024 17:51 — forked from chpatrick/nix-cmake
Using CLion with Nix

let's say you have a C++ project in Nix that you want to work on with CLion so that the nix dependencies are available.

  1. create a .nix utility directory in your project directory.
  2. put the below nix-run.sh and nix-cmake.sh in the .nix directory.
  3. in the .nix directory create symlinks for make, gcc, g++ - and maybe more tools, that need to have the nix dependencies and build tools available - and point them to nix-run.sh
  4. then, in Settings -> Build, Execution, Deployment -> Toolchains set CMake to the path to nix-cmake.sh and point all other build tools to the symlinks you've created.
@ityonemo
ityonemo / test.md
Last active March 20, 2024 06:57
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@spalladino
spalladino / falsehoods-that-ethereum-programmers-believe.md
Last active March 8, 2024 14:34
Falsehoods that Ethereum programmers believe

Falsehoods that Ethereum programmers believe

I recently stumbled upon Falsehoods programmers believe about time zones, which got a good laugh out of me. It reminded me of other great lists of falsehoods, such as about names or time, and made me look for an equivalent for Ethereum. Having found none, here is my humble contribution to this set.

About Gas

Calling estimateGas will return the gas required by my transaction

Calling estimateGas will return the gas that your transaction would require if it were mined now. The current state of the chain may be very different to the state in which your tx will get mined. So when your tx i

@jthodge
jthodge / universal-switcher
Created September 6, 2020 22:07
Show macOS app switcher across all monitors
defaults write com.apple.Dock appswitcher-all-displays -bool true
killall Dock
@natowi
natowi / audio2midi.md
Last active March 21, 2024 21:05
List of open source audio to midi packages
@lyninx
lyninx / partition.ex
Last active July 8, 2020 19:41
elixir function for splitting lists into equal sized chunks, written using recursion
# `partition/2` splits a list into smaller lists of a given size, using recursion!
#
# usage:
# list = [:one, :two, :three, :four, :five]
# partition(list, 2)
# > [[:one, :two], [:three, :four], [:five]]
def partition(list, partition_size)
when is_list(list)
and is_integer(partition_size)
@kipply
kipply / profile.rb
Last active September 17, 2022 08:41
Ruby Code ||= Lazy Initialization Profiling
# When run on the following 20 repositories, it found 2082 ||= and it was used as lazy init 64.3% of the time
# Those numbers are fuzzy, as there is not certain way to prove if something was used as a lazy init
# This script only marks a usage as a lazy init if the variable is being set to a constant,
# in which case if it is not a lazy init then the developers have done something weird.
# It is also marked as a lazy init if the variable is an instance variable or a class variable (either @var or @@var)
# AND the lazy init is used in the top level of a function, AND the function name is contained by the variable or vice versa.
# These are almost certain to be lazy initialized because the assumed behaviour is to always call the method instead of the variable,
# and other usages would be both weird usage of instance/class variables and/or weird usage of the method naming
# This of course, misses a variety of cases but likely does not get any cases that do not lazy initialize.
# A better way to profile could be
@DarthSim
DarthSim / 00.imgproxy_vs_alternatives.md
Last active January 28, 2024 16:11
imgproxy vs alternatives benchmark

imgproxy vs alternatives benchmark

Setup

  • c5.xlarge AWS instance: 4 CPUs, 8 GB RAM
  • Ubuntu 18.04
  • Go 1.12
  • Python 2.7
  • Vips 8.7.4