Skip to content

Instantly share code, notes, and snippets.

View kmsheng's full-sized avatar
🏠
Working from home

kmsheng kmsheng

🏠
Working from home
View GitHub Profile

開源之道

Original transcript: http://allisonrandal.com/2012/04/15/open-source-enlightenment/

這幾年來,我慢慢覺得,我們參與開源社群,就像是在一條道路上並肩而行:這不僅讓我們成為更好的程式設計者,也讓我們通過與人合作,而成為更好的人。

您可以將它想成一條修行之道,讓身而為人的我們能夠不斷成長。接下來,我想談談我對開源世界的個人觀點,希望能與您分享。

首先,人是一切開源專案的核心。程式碼是很重要,但最核心的永遠是人。

@kmsheng
kmsheng / README
Created February 11, 2014 08:21 — forked from joelambert/README
Drop in replace functions for setTimeout() & setInterval() that
make use of requestAnimationFrame() for performance where available
http://www.joelambert.co.uk
Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php
@kmsheng
kmsheng / README
Created February 11, 2014 08:27 — forked from joelambert/README
Drop in replace functions for setTimeout() & setInterval() that
make use of requestAnimationFrame() for performance where available
http://www.joelambert.co.uk
Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php
@kmsheng
kmsheng / README.md
Last active August 29, 2015 14:07 — forked from addyosmani/README.md

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

var ksa = require('ksana-simple-api');
ksa.filter({db: 'jiangkangyur', q: 'a'}, function(err, items) {
console.log('items', items);
});
@kmsheng
kmsheng / ksa-fetch-without-real-hits.js
Last active December 22, 2015 11:21
ksana fetch without realHits props
var ksa = require('ksana-simple-api');
ksa.fetch({db: 'jiangkangyur', q: 'ཨ', uti: ['1.95a', '1.276a']}, function(err, rows) {
console.log('rows', rows);
})l
const URL = 'https://api.dharma-treasure.org/kdbs/jiangkangyur/pbs/1-1-1b';
let result = '';
fetch(URL).then((res) => res.json())
.then((json) => {
result = json;
console.log('inside', result);
});
@kmsheng
kmsheng / https-instance-securitygroup.config
Created August 10, 2017 15:11
AWS Elastic Beanstalk single instance deploy using Docker and Let’s Encrypt Automatic SSL Certificate Renewal
Resources:
sslSecurityGroupIngress:
Type: AWS::EC2::SecurityGroupIngress
Properties:
GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]}
IpProtocol: tcp
ToPort: 443
FromPort: 443
CidrIp: 0.0.0.0/0
@kmsheng
kmsheng / fopen-example.c
Last active March 27, 2018 01:36
An example of how to write file in C
#include <stdio.h>
#include <string.h>
int main () {
int ret;
FILE *fp;
char filename[] = "/home/user1/file.txt";
fp = fopen(filename, "w");
@kmsheng
kmsheng / print.sh
Last active April 7, 2018 07:38
example of using shell arguments
#!/bin/bash
print_message() {
echo
echo "arguments are $0 $1 $2"
echo
}
print_message "first" "second"