Skip to content

Instantly share code, notes, and snippets.

@Kirkkt
Kirkkt / git diff ignoring certain files.md
Last active November 6, 2023 12:36
git diff ignoring certain files

git diff ignoring certain files

What is this?

Sometimes you want to ignore certain files when you run git diff, but you still want to check them in, which means you can't capitalize on .gitignore.

This guide is here to help.

How to set it up?

@ohanhi
ohanhi / joy-of-composition.md
Last active May 6, 2024 05:21
The Joy of Composition - Why stateless rendering is pure bliss

This is a proposal for a lightning talk at the Reactive 2015 conference.

NOTE: If you like this, star ⭐ the Gist - the amount of stars decides whether it makes the cut!

The Joy of Composition

Why stateless rendering is pure bliss

React just got stateless components, meaning that they are in essence pure functions for rendering. Pure functions make it dead simple - even fun - to refactor your views

{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts #-}
module Test where
import GHC.Generics
import Data.Proxy
typeName :: forall a. (Generic a, GTypeName (Rep a)) => Proxy a -> String
typeName Proxy = gtypename (from (undefined :: a))
@LukaJCB
LukaJCB / Algebra.purs
Last active September 22, 2019 13:01
Alternative Tagless Final encoding in PureScript
module Algebra where
import Prelude
import Control.Monad.Eff (Eff)
import Data.Maybe (Maybe(..))
newtype ConsoleAlg f = ConsoleAlg
{ printLn :: String -> f Unit
, readLn :: f String
@peti
peti / README.md
Last active January 29, 2024 00:21
Make NixOS provide version-specific LOCALE_ARCHIVE environment variables

This NixOS code ensures that the system provide version-specific $LOCALE_ARCHIVE environment variables to mitigate the effects of NixOS/nixpkgs#38991.

To deploy it, copy the file into your /etc/nixos folder using a file name like multi-glibc-locale-paths.nix. Then edit your configuration.nix file to contain the attribute:

imports = [ ./multi-glibc-locale-paths.nix ];
@mbbx6spp
mbbx6spp / nix-yarn2nix-bundix-packaging.org
Created November 15, 2018 21:41
Quick notes on what worked to package a frontend yarn JS project and how to update gems in an existing Ruby project using bundix for Nix based configuration.

Random Nix Project Packaging (yarn2nix, bundix -l)

Setting up a nodejs project via yarn2nix in Nix for existing project

  • nix-shell -p yarn yarn2nix nodejs
  • copied the Nix skeleton files in place (./z/etc/lib/{version,nixpkgs}.nix ./z/etc/overlays/default.nix)
  • generated package.nix using yarn2nix
  • add these Nix expressions in the root
@zimbatm
zimbatm / callPackage
Last active January 31, 2019 11:16
Usage: callPackage [path] [...nix-build args]
#!/usr/bin/env bash
#
# Usage: callPackage [src] [...nix-build args]
#
# A version of nix-build that uses nixpkgs.callPackage to fill in the
# arguments.
#
# * [src] can be a path or a URL. Defaults to .
#
# Example:
@justinwoo
justinwoo / script.js
Last active March 1, 2019 22:03
Make Discord easier to read
d=document,b=d.body,a=Array.from,s=d.createElement("style"),s.innerText="."+a(d.querySelectorAll("div")).flatMap(c=>a(c.classList)).find(c=>c.includes("markup"))+"{color:#111111!important}",b.append(s),b.style.fontFamily="Noto Sans CJK JP";