Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Steve Mao stevemao

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

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 / pres.js
Created Aug 6, 2019
Presentation in code editor
View pres.js
const i = (css) => document.head.insertAdjacentHTML('beforeend', `<style id="pres" class="pres">${css}</style>`);
const ir = () => document.getElementById("pres").outerHTML = "";
@stevemao
stevemao / index.html
Last active Dec 15, 2018 — forked from vasturiano/index.html
Newton's Cradle
View index.html
<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 Dec 15, 2018 — forked from rsk2327/index.html
collisionForce (forceCollide)
View index.html
<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 / You-Dont-Need-GUI.sh
Last active Nov 17, 2017
Search for a command that you are tempted to do with GUI
View You-Dont-Need-GUI.sh
# https://github.com/you-dont-need/You-Dont-Need-GUI
# dependency: https://github.com/axiros/terminal_markdown_viewer
# pip install mdv
# replace `'copy a file'` with whatever you are searching for
curl https://raw.githubusercontent.com/you-dont-need/You-Dont-Need-GUI/master/readme.md | mdv - | grep 'copy a file' -A 10
@stevemao
stevemao / nl.sh
Created Nov 9, 2017 — forked from yyx990803/nl.sh
npm list only top level modules.
View nl.sh
alias ng="npm list -g --depth=0 2>/dev/null"
alias nl="npm list --depth=0 2>/dev/null"
View watch-value
console = console || {}; // just in case
console.watch = function(oObj, sProp) {
sPrivateProp = "$_"+sProp+"_$"; // to minimize the name clash risk
oObj[sPrivateProp] = oObj[sProp];
// overwrite with accessor
Object.defineProperty(oObj, sProp, {
get: function () {
return oObj[sPrivateProp];
},
@stevemao
stevemao / fix_github_https_repo.sh
Created Jan 12, 2016 — forked from m14t/fix_github_https_repo.sh
Convert HTTPS github clones to use SSH
View fix_github_https_repo.sh
#/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
View simple-server-for-index-html.js
var fs = require('fs');
var html;
fs.readFile('./index.html', function (err, data) {
html = data;
});
require('http').createServer(function (request, response) {
response.end(html);
View gist:5fa37328581a749238f8
# copied from https://github.com/bendrucker/make-module/blob/master/module.sh
module () {
cd ~/Code
mkdir $1
cd $1
git init
hub create
travis enable --no-interactive &
yo bd
}