Skip to content

Instantly share code, notes, and snippets.

On vacation

wind smileboywtu

On vacation
Block or report user

Report or block smileboywtu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Balsamiq mockups Serial
Organization name:
Serial Key: eNrzzU/OLi0odswsqslJTa3IzHJIz03MzNFLzs+tMTQyNrcwsTQyAIEa5xpDAIFxDy8k
View xpath-cheatsheet.js
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// 0. XPath Examples.
// More:
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
View estraverse_traverse.js
var esprima = require("esprima");
var estraverse = require("estraverse");
var ast = esprima.parse(`
function level1() {
function level2() {
function level1_1() {
View estraverse_example.js
function level1() {
function level2() {
function level1_1() {
smileboywtu / docker-compose.yaml
Created Apr 1, 2019
monog db replicate with docker compose
View docker-compose.yaml
version: "3"
image: mvertes/alpine-mongo
restart: always
- "27017:27017"
entrypoint: [ "/usr/bin/mongod", "--port", "27017", "--bind_ip_all", "--replSet", "rs"]
smileboywtu /
Created Oct 24, 2018 — forked from joepie91/
Secure random values (in Node.js)

Not all random values are created equal - for security-related code, you need a specific kind of random value.

A summary of this article, if you don't want to read the entire thing:

  • Don't use Math.random(). There are extremely few cases where Math.random() is the right answer. Don't use it, unless you've read this entire article, and determined that it's necessary for your case.
  • Don't use crypto.getRandomBytes directly. While it's a CSPRNG, it's easy to bias the result when 'transforming' it, such that the output becomes more predictable.
  • If you want to generate random tokens or API keys: Use uuid, specifically the uuid.v4() method. Avoid node-uuid - it's not the same package, and doesn't produce reliably secure random values.
  • If you want to generate random numbers in a range: Use random-number-csprng.

You should seriously consider reading the entire article, though - it's

View gist:3d58224e3f859e33421ca4b10339dd17

There are two types of markup in Liquid: Output and Tag.

  • Output markup (which may resolve to text) is surrounded by
{{ matched pairs of curly brackets (ie, braces) }}
  • Tag markup (which cannot resolve to text) is surrounded by
smileboywtu / Dockerfile
Created Jun 30, 2018 — forked from orenitamar/Dockerfile
Installing numpy, scipy, pandas and matplotlib in Alpine (Docker)
View Dockerfile
# Below are the dependencies required for installing the common combination of numpy, scipy, pandas and matplotlib
# in an Alpine based Docker image.
FROM alpine:3.4
RUN echo "" >> /etc/apk/repositories
RUN apk --no-cache --update-cache add gcc gfortran python python-dev py-pip build-base wget freetype-dev libpng-dev openblas-dev
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h
RUN pip install numpy scipy pandas matplotlib
smileboywtu /
Created Jun 27, 2018 — forked from jae-jae/
# Ubuntu安装并配置aria2
# @Author: Jaeger <>
# @Version: 0.1
smileboywtu /
Created Apr 24, 2018
simple python daemon worker
# -*- coding: utf-8 -*-
sync device status data from hive
import argparse
import json
You can’t perform that action at this time.