Skip to content

Instantly share code, notes, and snippets.

View curist's full-sized avatar
😮

Chung-Yu Chang curist

😮
View GitHub Profile
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC/ynzuy0rcHCoJFmrChH6cZJk8fUAw3118qC6opz40qXhA6tw6EB6Uv7CPDQHcubnqVSzR0WWHh2da7VaIaqhd6SWcjIq/qjuCC3fYKwZd4m5gr+j6YLTQFDUuXvSEfublE26FdTECp1mEf2EIrPOWdya0a7N3T+lYASNEXdN0Q0OmBL0FCrk7gyNIAnwg8oEK2xCGO/ppDcoZ//IFoi7HaMB2+5pQC1ezPCxVJkqg273aUu0OTQUm/fBCCUUZ4sBR6ejDcE4G6Ftu6bty18S2SxiDO1CGQB31i9XGtnFrpSZ4SfXSC9pGlgj3SMl0wM6MQ9zW/gnenPjElX0L3F6/ curist@blank
@curist
curist / bb-edn.lua
Last active January 13, 2025 12:45
overseer babashka template
-- lua/overseer/tempalte/bb-edn.lua
local bbscript = [[
(require '[clojure.edn :as edn])
(require '[cheshire.core :as json])
(assert *command-line-args*)
(def bbedn (slurp (first *command-line-args*)))
(def template (edn/read-string bbedn))
(def tasks (->> (keys (:tasks template))
(filter symbol?)
@curist
curist / showModal.js
Last active January 22, 2021 02:30
Vue showModal util
import Vue from 'vue';
export const showModal = function(comp, props = {}) {
let resolve, $el;
const modalContainer = new Vue({
render(h) {
return h(comp, {
props: {
...props,
handleFinish,
[user]
name = curist
email = [email protected]
[color]
ui = auto
[alias]
lg = log --pretty=format:'%Cred%h%Creset %Cgreen(%cr)%Creset %an%C(yellow)%d%Creset%n%B' --abbrev-commit --date=relative --graph
st = status
co = checkout
ci = commit -a
jdoc() {
export JANET_PATH=/usr/local/lib/janet
janet -l ~/scripts/misc/import-all -e '(import-all) (each b (all-bindings) (print b))' \
| fzf --preview "echo {} | xargs -I[] \
janet -l ~/scripts/misc/import-all \
-e '(import-all) \
(def is-fun (let [t (type [])] (or (= t :function) (= t :cfunction)))) \
(if is-fun (doc []) (do (pp (type []))(pp [])))' \
| sed 's/^\s*//g' \
| awk NF" \
(import uv)
(def host "127.0.0.1")
(def port 10043)
(def server (uv/tcp/new))
(defn handler [&]
(def client (uv/tcp/new))
(print "connected")
@curist
curist / tutorial.md
Created August 25, 2018 13:28 — forked from swalkinshaw/tutorial.md
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.

@curist
curist / regression_prediction.js
Created June 16, 2017 04:36
Using shaman.js, dump trained model, and use it to do prediction.
const { LinearRegression } = require('shaman');
require('sylvester');
LinearRegression.prototype.dump = function() {
return {
means: this.means,
ranges: this.ranges,
theta: this.theta.elements,
}
};
/*global module:false*/
module.exports = function (grunt) {
// show elapsed time at the end
require('time-grunt')(grunt);
// load all grunt tasks
require('jit-grunt')(grunt, {});
grunt.initConfig({
bower: {
common: {
@curist
curist / business-models.md
Created October 19, 2016 09:09 — forked from ndarville/business-models.md
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google