- ACİL KURTARMA TEKNİKLERİ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install nix (5.5 mins) | |
curl https://nixos.org/nix/install | sh | |
# open a new shell to source nix | |
bash | |
# query available haskell compilers | |
nix-env -qaP -A nixpkgs.haskell.compiler [QUERY] | |
# install ghc (2.5 mins, cached binary) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def bulk_upsert(model, fields, values, by): | |
""" | |
Return the tuple of (inserted, updated) ids | |
""" | |
result = (None, None) | |
if values: | |
stmt = """ | |
WITH data_set AS ( | |
INSERT INTO %s (%s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://webreflection.medium.com/using-the-input-datetime-local-9503e7efdce | |
Date.prototype.toDatetimeLocal = | |
function toDatetimeLocal() { | |
var | |
date = this, | |
ten = function (i) { | |
return (i < 10 ? '0' : '') + i; | |
}, | |
YYYY = date.getFullYear(), | |
MM = ten(date.getMonth() + 1), |
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using the erlang mechanism of tuple modules it is possible to create a "stateful module". | |
# This concept of a stateful module is discussed in "Programming erlang" Second edition. | |
defmodule User do | |
defstruct name: nil, admin: false, internal: "kinda private" | |
def new(name, options \\ []) do | |
dependencies = struct(%__MODULE__{name: name}, options) | |
{__MODULE__, dependencies} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Lists of countries with ISO 3166 codes, presented in various formats. | |
// Last Updated: July 30, 2020 | |
// If you're using PHP, I suggest checking out: | |
// https://github.com/thephpleague/iso3166 | |
// or Laravel: https://github.com/squirephp/squire | |
// | |
// JS developers can check out: | |
// https://www.npmjs.com/package/iso3166-2-db | |
// |