Skip to content

Instantly share code, notes, and snippets.

View argumatronic's full-sized avatar
🏠
Working from home

Julie Moronuki argumatronic

🏠
Working from home
View GitHub Profile
For each pixel on the screen do:
{
x0 = scaled x co-ordinate of pixel (must be scaled to lie somewhere in the interval (-2.5 to 1)
y0 = scaled y co-ordinate of pixel (must be scaled to lie somewhere in the interval (-1, 1)
ESCAPE = 2*2
x = 0
y = 0
iteration = 0
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@JoshCheek
JoshCheek / why_i_chose_fish_over_bash_for_students.md
Last active December 14, 2021 20:30
Why I Chose Fish Over Bash For Students

Why I chose Fish over Bash for students

I'm currently the lead instructor at Code Platoon and an instructor/developer at the Turing School of Software and Design.

I've been advocating the Fish shell and when the choice is up to me, I choose that for my students. Enough people ask about the decision, particularly in relation to the preinstalled Bash shell, that I figured it's worth laying out my reasoning.

TL;DR

@afldcr
afldcr / FunctorSet.hs
Last active June 19, 2016 23:14
Sets can be a functor in Haskell, too. They just aren't.
{-# LANGUAGE RankNTypes #-}
import Control.Monad.State (State, gets, put)
import Data.Set (Set)
import qualified Data.Set as S
newtype SetF a =
SetF (forall x. Ord x => (a -> x) -> Set x)
instance Ord a => Eq (SetF a) where
chris@renzo ~> cat ~/.stack/config.yaml
# This file contains default non-project-specific settings for 'stack', used
# in all projects. For more information about stack's configuration, see
# http://docs.haskellstack.org/en/stable/yaml_configuration.html
#
nix:
enable: true
pure: false
shell-file: /home/chris/.stack/shell.nix
newtype ConjList a = ConjList [a] deriving Show
instance Monoid a => Monoid (ConjList a) where
mempty = ConjList $ repeat mempty
mappend (ConjList x) (ConjList y) = ConjList $ zipWith mappend x y
λ> mappend (ConjList ["ab", "cd"]) (ConjList ["xc", "xy", "xp"])
ConjList ["abxc","cdxy"]
it :: (Monoid a, Data.String.IsString a) => ConjList a
@rycee
rycee / home-configuration.nix.5
Last active March 8, 2024 18:30
home-configuration.nix(5)
CONFIGURATION.NIX(5) NixOS Reference Pages CONFIGURATION.NIX(5)
NAME
configuration.nix - NixOS system configuration specification
DESCRIPTION
The file /etc/nixos/configuration.nix contains the declarative
specification of your NixOS system configuration. The command
@rajadain
rajadain / github-hasklig-fira-code-style.css
Last active February 6, 2019 19:43
Hasklig / Fira Code on GitHub Stylish CSS
@-moz-document domain("github.com"), domain("gist.github.com"), domain("render.githubusercontent.com") {
/* Hasklig https://github.com/i-tu/Hasklig */
/* Fira Code https://github.com/tonsky/FiraCode */
/* Ligaturizer https://github.com/ToxicFrog/Ligaturizer */
.branch-name,
.blob-num,
.blob-code-inner,
.CodeMirror pre,
.commit .sha,
.commit-desc pre,
@chris-martin
chris-martin / lazy.md
Last active September 16, 2017 20:16

Let's say we want to test whether the list [1,2,3,4,5] contains 2.

We could do this by turning the list of integers [1,2,3,4,5] into a list of Booleans [False, True, False, False, False] indicating, for each element in the original list, whether it is equal to 2.

λ> x = map (== 2) [1..5]
@cocreature
cocreature / Derangement.hs
Created January 10, 2018 18:32
An explanation for the benchmark results in https://github.com/vmchale/ats-benchmarks
-- This gist provides an explanation for why Haskell is significantly
-- faster than ATS and Rust in [vmchale’s great
-- benchmarks](https://github.com/vmchale/ats-benchmarks). What’s
-- happening is that the `derangements` list gets memoized so the
-- benchmark only checks the performance of (!!). `derangements'`
-- prevents GHC from memoizing the list and results in a significant
-- loss of performance. Criterion does try to prevent memoization but
-- it only prevents memoization of the function application (that’s
-- why the function and the argument need to be passed separately to
-- `nf`). It cannot prevent the memoization of the `derangements`