Skip to content

Instantly share code, notes, and snippets.

@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";
@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:
@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
@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 ];
@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
{-# 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))
@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

@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?

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@addyosmani
addyosmani / README.md
Last active September 4, 2024 11:40 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version