immutable = deeply frozen
- TrueClass
- FalseClass
- NilClass
- Integer
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.
.nix
utility directory in your project directory.nix-run.sh
and nix-cmake.sh
in the .nix
directory..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
nix-cmake.sh
and point all other build tools to the symlinks you've created.This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/
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)
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.
estimateGas
will return the gas required by my transactionCalling 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
defaults write com.apple.Dock appswitcher-all-displays -bool true | |
killall Dock |
# `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) |
# 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 |