Skip to content

Instantly share code, notes, and snippets.

@cpylua
cpylua / input.scss
Created December 10, 2020 05:14
Generated by SassMeister.com.
// TODO: define your theme overrides here, and that's all!
$theme-overrides: (
--theme-primary-1: #252b6e,
--theme-primary-2: #3c46b1,
--theme-primary-3: #434fc9,
--theme-primary-4: #515ff0,
--theme-primary-5: #6c78f2,
--theme-primary-6: #7e88f3,
--theme-primary-7: #b0b6f8,
--theme-primary-8: #f2f3fe,
@cpylua
cpylua / input.scss
Created November 18, 2020 09:40
Generated by SassMeister.com.
// TODO: define your theme overrides here, and that's all!
$theme-overrides: (
--theme-primary-1: #252b6e,
--theme-primary-2: #3c46b1,
--theme-primary-3: #434fc9,
--theme-primary-4: #515ff0,
--theme-primary-5: #6c78f2,
--theme-primary-6: #7e88f3,
--theme-primary-7: #b0b6f8,
--theme-primary-8: #f2f3fe,
@cpylua
cpylua / input.scss
Created November 18, 2020 09:29
Generated by SassMeister.com.
// sass-lint:disable no-duplicate-properties
// Text colors
$theme-stroke-1: #323233 !default; // text
$theme-stroke-2: #646566 !default; // text
$theme-stroke-3: #969799 !default; // help text
$theme-stroke-4: #c8c9cc !default; // disabled text
// Border and line colors
$theme-stroke-5: #dcdee0 !default;
@cpylua
cpylua / setup-youtube-dl.sh
Last active November 13, 2019 01:42
youtube-dl on termux
#!/bin/sh
# Usage:
# 1. Open a Termux session
# 2. Copy and run the below command in Termux
# source <(curl -s "https://gist.githubusercontent.com/cpylua/f7d1c6e5c22f5e0aa24349a8a20742c4/raw/setup-youtube-dl.sh?t=$(date +%s)")
pkg update && pkg upgrade && pkg install python ffmpeg
pip install --upgrade pip && pip install youtube-dl
@cpylua
cpylua / bootstrap.sh
Created September 18, 2017 02:19
update-zent-dep
#!/bin/sh
git checkout master
git pull
yarn
yarn bootstrap
pushd site
yarn
popd
@cpylua
cpylua / alfred-pinyin.py
Created January 4, 2016 16:12 — forked from tiann/alfred-pinyin.py
make alfred support pinyin search
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# @author weishu @2015/12/7
import subprocess
import os
import re
import json
@cpylua
cpylua / fib.ts
Created November 24, 2015 03:41 — forked from sampsyo/fib.ts
function inheritance in TypeScript
// This is a quick demonstration of "function inheritance" as described in
// this paper from Daniel Brown and William Cook.
// http://www.cs.utexas.edu/users/wcook/Drafts/2009/sblp09-memo-mixins.pdf
// Expressed in TypeScript (and without the monads).
// Syntax note: When you write function types in TypeScript, you need to name
// each parameter. But the names don't actually matter, so I just use _. You
// can read `(_:A) => B` as `a -> b` in ML or Haskell syntax.
// In Brown and Cook's Haskell, `type Gen a = a -> a` is a "generator." The
@cpylua
cpylua / immutable-libraries.md
Created November 3, 2015 06:30 — forked from jlongster/immutable-libraries.md
List of immutable libraries

A lot of people mentioned other immutable JS libraries after reading my post. I thought it would be good to make a list of available ones.

There are two types of immutable libraries: simple helpers for copying JavaScript objects, and actual persistent data structure implementations. My post generally analyzed the tradeoffs between both kinds of libraries and everything applies to the below libraries in either category.

Libraries are sorted by github popularity.

Persistent Data Structures w/structural sharing

@cpylua
cpylua / d3circlepack.html
Created March 6, 2015 09:26
D3 Circle Pack
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<link type="text/css" rel="stylesheet" href="http://mbostock.github.io/d3/talk/20111116/style.css"/>
<style type="text/css">
text {
font-size: 11px;
@cpylua
cpylua / Highcharts Data Interface
Last active August 29, 2015 14:16
HighCharts Data Interface
##Conclusion
*Impossible* for automatic conversion, time consuming for manual conversion. The data and options used by different charts varies... and there're too many chart types. But customize it for specific usage should be relatively easy. I'm wondering if we can remove it from our gallery, instead we tell our customers it's possible to use Highcharts in our VI framework.
> Written with [StackEdit](https://stackedit.io/).