Skip to content

Instantly share code, notes, and snippets.

View stevemao's full-sized avatar
🎯
Focusing

Steve Mao stevemao

🎯
Focusing
View GitHub Profile
@stevemao
stevemao / bookmarks.md
Created April 19, 2020 00:48 — forked from haskie-lambda/bookmarks.md
A collection of bookmarks

Bookmarks

A collection of bookmarks covering the topics of

  • functional programming with haskell
  • type theory
  • category theory
  • formal verification
  • interesting stuff for haskellers

Sites for rescources

@stevemao
stevemao / index.html
Last active December 15, 2018 10:18 — forked from vasturiano/index.html
Newton's Cradle
<head>
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/4.8.0/d3.min.js"></script>
<script src="//unpkg.com/d3-force-bounce"></script>
<script src="//unpkg.com/d3-force-constant"></script>
<link rel="stylesheet" href="style.css">
</head>
<body>
<svg id="canvas">
@stevemao
stevemao / index.html
Created December 15, 2018 09:00 — forked from rsk2327/index.html
collisionForce (forceCollide)
<html>
<head>
<title>collisionForce</title>
<script type="text/javascript" src = "https://d3js.org/d3.v4.min.js"></script>
<style type = "text/css">
.active {
stroke: #000;
stroke-width: 2px;
}
@stevemao
stevemao / nl.sh
Created November 9, 2017 03:23 — forked from yyx990803/nl.sh
npm list only top level modules.
alias ng="npm list -g --depth=0 2>/dev/null"
alias nl="npm list --depth=0 2>/dev/null"
@stevemao
stevemao / fix_github_https_repo.sh
Created January 12, 2016 11:43 — forked from m14t/fix_github_https_repo.sh
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi
@stevemao
stevemao / post-merge
Last active October 25, 2022 11:49 — forked from sindresorhus/post-merge
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@stevemao
stevemao / np.sh
Last active June 15, 2022 00:37 — forked from sindresorhus/np.sh
Publish node module
# npm publish with goodies
# prerequisites:
# `npm install -g trash conventional-recommended-bump conventional-changelog conventional-github-releaser conventional-commits-detector json`
# `np` with optional argument `patch`/`minor`/`major`/`<version>`
# defaults to conventional-recommended-bump
# and optional argument preset `angular`/ `jquery` ...
# defaults to conventional-commits-detector
np() {
travis status --no-interactive &&
trash node_modules &>/dev/null;