Skip to content

Instantly share code, notes, and snippets.

Avatar

Chunliang Lyu cllu

View GitHub Profile
@jbenet
jbenet / tikz2svg
Last active May 25, 2020
tikz2svg - convert tikz input into svg
View tikz2svg
#!/usr/bin/env python
#
# author: github.com/jbenet
# license: MIT
#
# tikz2svg: convert tikz input into svg
# depends on:
# - pdflatex: comes with your tex dist
# - pdf2svg: brew install pdf2svg
@dominicsayers
dominicsayers / elasticsearch.md
Last active Apr 24, 2020
Configuring ElasticSearch to use less memory
View elasticsearch.md

What I actually did

/etc/security/limits.conf

elasticsearch hard memlock 100000

/etc/default/elasticsearch

View wechat2txt.py
import os
import sys
import re
import hashlib
import csv
import time
import locale
import getopt
View wechat2txt.py
if 64 - 64: i11iIiiIii
if 65 - 65: O0 / iIii1I11I1II1 % OoooooooOO - i1IIi
if 73 - 73: II111iiii
if 22 - 22: I1IiiI * Oo0Ooo / OoO0O00 . OoOoOO00 . o0oOOo0O0Ooo / I1ii11iIi11i
import os
if 48 - 48: oO0o / OOooOOo / I11i / Ii1I
if 48 - 48: iII111i % IiII + I1Ii111 / ooOoO0o * Ii1I
if 46 - 46: ooOoO0o * I11i - OoooooooOO
if 30 - 30: o0oOOo0O0Ooo - O0 % o0oOOo0O0Ooo - OoooooooOO * O0 * OoooooooOO
if 60 - 60: iIii1I11I1II1 / i1IIi * oO0o - I1ii11iIi11i + o0oOOo0O0Ooo
@jwalton
jwalton / Dashing EC2.md
Last active Oct 10, 2019
EC2 CloudWatch stats for Dashing
View Dashing EC2.md

Get EC2 CloudWatch stats and graph them in Dashing.

@jwalton
jwalton / RickshawGraph.md
Last active May 15, 2019
Rickshaw Graph is a drop in replacement for Dashing's graph
View RickshawGraph.md

Graphing Widget

The graphing widget shows graphs using the Rickshaw graphing library. The names of data fields should be (vaguely) familiar if you've used Rickshaw before.

It's recommended that you replace the /assets/javascripts/rickshaw.min.js from your dashboard with the latest from here.

Supported HTML data fields

@stevenleeg
stevenleeg / pie.coffee
Last active Feb 29, 2020
A simple d3 pie chart widget for Dashing.
View pie.coffee
class Dashing.Pie extends Dashing.Widget
@accessor 'value'
onData: (data) ->
@render(data.value)
render: (data) ->
if(!data)
data = @get("value")
if(!data)
@minrk
minrk / nbstripout
Last active Jun 14, 2020
git pre-commit hook for stripping output from IPython notebooks
View nbstripout
#!/usr/bin/env python
"""strip outputs from an IPython Notebook
Opens a notebook, strips its output, and writes the outputless version to the original file.
Useful mainly as a git filter or pre-commit hook for users who don't want to track output in VCS.
This does mostly the same thing as the `Clear All Output` command in the notebook UI.
LICENSE: Public Domain
@algal
algal / nginx-cors.conf
Created Apr 29, 2013
nginx configuration for CORS (Cross-Origin Resource Sharing), with an origin whitelist, and HTTP Basic Access authentication allowed
View nginx-cors.conf
#
# A CORS (Cross-Origin Resouce Sharing) config for nginx
#
# == Purpose
#
# This nginx configuration enables CORS requests in the following way:
# - enables CORS just for origins on a whitelist specified by a regular expression
# - CORS preflight request (OPTIONS) are responded immediately
# - Access-Control-Allow-Credentials=true for GET and POST requests
@trinitronx
trinitronx / truecrypt_fix.bash
Last active Mar 21, 2017 — forked from jimjh/truecrypt_fix.bash
Fixes annoying brew doctor messages caused by Truecrypt
View truecrypt_fix.bash
#!/bin/bash
libs=( "/usr/local/lib/libmacfuse_i32.2.dylib" \
"/usr/local/lib/libosxfuse_i32.2.dylib" \
"/usr/local/lib/libosxfuse_i64.2.dylib" \
"/usr/local/lib/libmacfuse_i64.2.dylib" \
"/usr/local/lib/libosxfuse_i32.la" \
"/usr/local/lib/libosxfuse_i64.la" \
"/usr/local/lib/pkgconfig/osxfuse.pc" )
You can’t perform that action at this time.