Skip to content

Instantly share code, notes, and snippets.

View kindy's full-sized avatar

Kindy Lin kindy

  • Beijing, China
  • 09:18 (UTC +08:00)
  • LinkedIn in/kindy
View GitHub Profile
@kindy
kindy / polyfill.document.createTreeWalker.js
Created December 3, 2018 09:06 — forked from radum/polyfill.document.createTreeWalker.js
polyfill.document.createTreeWalker.js
/* eslint no-param-reassign: 0 */
/**
* JavaScript implementation of W3 DOM4 TreeWalker interface.
*
* See also:
* - https://dom.spec.whatwg.org/#interface-treewalker
*
* Attributes like "read-only" and "private" are ignored in this implementation
* due to ECMAScript 3 (as opposed to ES5) not supporting creation of such properties.
@kindy
kindy / gist:777f013083e101941d0684358529ca18
Created August 7, 2018 08:48 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Using self-signed certificate.

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
@kindy
kindy / README.md
Created April 4, 2018 02:04 — forked from MoOx/README.md
How to keep in sync your Git repos on GitHub, GitLab & Bitbucket easily
title tags authors
How to keep in sync your Git repos on GitHub, GitLab & Bitbucket easily
git
github
gitlab
bitbucket
MoOx

Google Apps Script Document Utilities

  • getAllLinks.js

  • getAllLinks(element) - returns array of all UrlLinks in Document

  • findAndReplaceLinks(searchPattern,replacement) - changes all matching links in Document

  • changeCase.js - Document add-in, provides case-change operations in the add-in Menu.

  • onOpen - installs "Change Case" menu

  • _changeCase - worker function to locate selected text and change text case. Case conversion is managed via callback to a function that accepts a string as a parameter and returns the converted string.

  • helper functions for five cases

@kindy
kindy / group_vars
Created February 24, 2016 06:30 — forked from charypar/group_vars
Deploying SSL keys securely with Ansible (code)
---
ssl_certificates:
- certificate_src: secure.example.com.pem
certificate_dest: /etc/ssl/certs/secure.example.com.pem
key_src: secure.example.com.protected.key
key_dest: /etc/ssl/private/secure.example.com.protected.key
key_stripped: /etc/ssl/private/secure_example.com.key
key_password: "{{ssl_passphrase}}"
@kindy
kindy / example.com
Last active August 29, 2015 14:27 — forked from mignev/example.com
Django deployment with Nginx and Tornado Web
upstream tornadoFrontends {
server 127.0.0.1:8000;
server 127.0.0.1:8001;
server 127.0.0.1:8002;
server 127.0.0.1:8003;
}
server {
listen 80;
@kindy
kindy / crawler.py
Last active August 29, 2015 14:24 — forked from jmoiron/crawler.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Simple async crawler/callback queue based on gevent."""
import traceback
import logging
import httplib2
import gevent
@kindy
kindy / index.html
Created September 24, 2013 13:14 — forked from mbostock/.block
<!DOCTYPE html>
<meta charset="utf-8">
<style>
circle {
stroke: #fff;
}
</style>
<body>
@kindy
kindy / index.html
Created September 17, 2013 02:28 — forked from mbostock/.block
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>OMG Particles!</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.25.0"></script>
<style type="text/css">
body {
background: #222;
@kindy
kindy / arbase.lua
Created June 11, 2012 12:17 — forked from stuartpb/arbase.lua
Function for using arbitrary digit systems to convert numbers to strings
local function base (digit_list)
local b = #digit_list
if b == 0 then
return function(number) return "" end
elseif b == 1 then
local mark = digit_list[1]
return function(number)
return string.rep(mark, number)
end
else