Skip to content

Instantly share code, notes, and snippets.

View antonlogvinenko's full-sized avatar
☠️
kept you waiting huh

antonlogvinenko

☠️
kept you waiting huh
View GitHub Profile
@kconner
kconner / macOS Internals.md
Last active May 25, 2024 19:26
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

import Control.Monad
import Data.Foldable
import Data.Functor
import Data.List
import Data.Maybe
import Data.Time.Clock
import System.Directory
import System.Process
main = listPackages >>= filterM needsUpdate >>= traverse_ update
@travisbrown
travisbrown / top-promoter-names-01.csv
Last active August 17, 2023 05:53
Screen names for all of the top 10k "promoter" accounts from sTechLab/VoterFraud2020
Twitter ID Status Followers Screen names
25073877 ❌ suspended realDonaldTrump
187680645 ❌ suspended LLinWood
770781940341288960 ☑️ active 1,137,346 RudyGiuliani, xxxxxxx37583982
26487169 ☑️ active 2,144,540 LouDobbs, loudobbsnews
4041824789 ☑️ active 618,434 RSBNetwork
240454812 ❌ suspended GenFlynn
586707638 ❌ suspended SidneyPowell1
2853461537 ☑️ active 656,713 ScottAdamsSays
16989178 ❌ suspended JamesOKeefeIII
{- cabal:
build-depends: base, constraints
-}
{-# language TypeFamilies, TypeFamilyDependencies, ConstraintKinds, ScopedTypeVariables, NoStarIsType, TypeOperators, TypeApplications, GADTs, AllowAmbiguousTypes, FunctionalDependencies, UndecidableSuperClasses, UndecidableInstances, FlexibleInstances, QuantifiedConstraints, BlockArguments, RankNTypes, FlexibleContexts, StandaloneKindSignatures, DefaultSignatures #-}
-- ⊷, ≕, =∘, =◯ These choices all look like something out of Star Trek, so let's boldly go...
import Data.Constraint hiding (top, bottom, Bottom)
import Data.Kind
import Data.Some
@graninas
graninas / What_killed_Haskell_could_kill_Rust.md
Last active May 25, 2024 13:50
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?

@AlexeyRaga
AlexeyRaga / 1CPrelude.hs
Created March 31, 2020 06:15
1с-подобный Хаскель
---------------- Базовое ----------------------
type Число = Int
type Строка = Text
type Строчное = Show
type ИО = IO
type Сравнимое = Eq
type Упорядоченное = Ord
печатать :: Строчное значение => значение -> ИО ()
печатать = print

List Comprehension and Monoid Comprehension Extra Credit

Complete as much as you can. Partial credit is possible. No due date, turn in whenever.

Problem 1: List Comprehensions to For Loops

For each pseudo-code program, write an equivalent pseudo-code program using for loops. (See Problem 2 below for examples of for loops in the pseudo-code notation I'd like you to use. It's very much like Python.) [1 point each]

a.

@ctrlcctrlv
ctrlcctrlv / rust-maintainer-perfectionism.md
Last active January 4, 2024 15:42
Rust maintainer perfectionism

Rust maintainer perfectionism, or, the tragedy of Alacritty

I did not submit this to Hacker News and did not intend that this post would have high circulation but have no real problem with it being there or with it having such. I have more recent comments below. This post is from January 2020 and predates the Modular Font Editor K (MFEK) project.

I have not worked on Rust projects in quite a while, and don't know if I ever will again. I feel many crate maintainers are way too perfectionist, for example, despite all the developer hours that went into this PR, it took the effort within years to be (halfway) merged.

There's always a reason not to merge, isn't there? It would be better done with a new nightly language feature, or the function signature should have a where clause, or the documentation is not perfect. There's always a new nit to pick in the world of Ru

@graninas
graninas / haskell_approaches_comparison_table.md
Last active April 25, 2024 20:49
Haskell Approaches Comparison Table

An Opinionated Comparison of Software Design Approaches in Haskell

| | Raw IO | Free Monads; Church Encoded Free Monads | Final Tagless / mtl | Effect Systems | ReaderT

@mpm
mpm / postgres-loop.sql
Created November 15, 2019 16:42
Loop through a list of ids and perform a statement for each (in PostgreSQL)
-- Loop through a list of static ids and perform an insert (or any other) statement on each
-- Can be pasted directly into pgsql and does not need to be part of a stored procedure
DO
$do$
DECLARE
pid int;
BEGIN
FOREACH pid IN ARRAY array[1, 5, 22, 100] LOOP
INSERT INTO comments (text, post_id, updated_at)VALUES('This comment was inserted for four records.', pid, NOW(), NOW());
END LOOP;