Skip to content

Instantly share code, notes, and snippets.

View rnons's full-sized avatar

Ping Chen rnons

View GitHub Profile
@rnons
rnons / encrypted-git-repo.md
Created March 11, 2021 03:09 — forked from polonskiy/encrypted-git-repo.md
Transparent Git Encryption

Transparent Git Encryption

This document has been modified from its [original format][m1], which was written by Ning Shang (geek@cerias.net). It has been updated and reformatted into a [Markdown][m2] document by [Woody Gilk][m3] and [republished][m4].

Description

When working with a remote git repository which is hosted on a third-party storage server, data confidentiality sometimes becomes

@rnons
rnons / Main.hs
Created December 19, 2019 12:49
A persistent playground
-- nix-shell
-- ghcid -c 'ghci Main.hs'
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
@rnons
rnons / emacs.md
Created July 20, 2019 01:17
emacs links
((nil . ((eval . (prettier-js-mode 0)))))

Keybase proof

I hereby claim:

  • I am rnons on github.
  • I am rnons (https://keybase.io/rnons) on keybase.
  • I have a public key ASDW8E9Slip-smsA9mIc-6FxpjPATvn9rbGZQ1y3kPhBoAo

To claim this, I am signing this object:

@rnons
rnons / what-forces-layout.md
Created October 9, 2016 02:39 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@rnons
rnons / README.md
Created September 27, 2016 14:51 — forked from addyosmani/README.md
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

@rnons
rnons / loading.svg
Last active October 19, 2015 10:05
A loading animation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rnons
rnons / track_twitter_stream.hs
Last active August 29, 2015 14:20
Track twitter stream and send to BearyChat
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternGuards #-}
import Control.Lens hiding ((.=))
import Control.Monad
import Control.Monad.IO.Class
import Data.Aeson ((.=), object, encode)
import qualified Data.ByteString.Lazy as L
import qualified Data.Conduit as C
import qualified Data.Conduit.List as CL
@rnons
rnons / pr_report.hs
Created May 8, 2015 07:06
Report pull request numbers to BearyChat
#!/usr/bin/env runhaskell
{-# LANGUAGE OverloadedStrings #-}
import Control.Applicative ((<$>))
import Control.Monad (forM, void, when)
import Data.Aeson ((.=), Value, object, encode, decode)
import qualified Data.ByteString.Lazy as L
import Data.Maybe (fromMaybe, fromJust)
import Data.List (intercalate)
import Network.HTTP.Conduit ( Request(..), applyBasicAuth, parseUrl