Skip to content

Instantly share code, notes, and snippets.

@RichardHan
RichardHan / win_change_javapath_by_mklink
Created June 20, 2016 11:30
Windows change JAVA path by mklink
@RichardHan
RichardHan / docker_remove_all_imgs_conts
Created June 19, 2016 14:29
Docker: Remove all images and containers
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@RichardHan
RichardHan / Get_all_stored_procedure_code_to_one_column.sql
Last active April 20, 2016 08:59
Get all stored procedure code to one column
DECLARE c CURSOR READ_ONLY FAST_FORWARD FOR
SELECT name
FROM dbo.sysobjects
WHERE (type = 'P') and name not like 'sp_%' order by name
DECLARE @name nvarchar(255)
declare @result varchar(MAX)
set @result = ''
@RichardHan
RichardHan / react-tutorial.js
Last active March 16, 2016 02:59
React react-tutorial-sample code.
/**
* Clone from https://github.com/reactjs/react-tutorial/tree/master/public
*/
var Comment = React.createClass({
rawMarkup: function() {
var rawMarkup = marked(this.props.children.toString(), {sanitize: true});
return { __html: rawMarkup };
},
@RichardHan
RichardHan / powershell_count_item_recurse
Last active March 16, 2016 02:58
PowerShell - Count item recurse in folder file
$server_dir = 'C:\somewhere'
if(Test-Path $server_dir)
{
$folders = Get-ChildItem $server_dir | where {$_.PSIsContainer}
$output = @()
foreach($folder in $folders)
{
$fname = $folder.Name
@RichardHan
RichardHan / unix_pretty_print
Last active March 16, 2016 02:59
Unix shell pretty-print JSON in unix shell
#
# Use JSON.stringify
#
$ node -e "console.log(JSON.stringify(JSON.parse(process.argv[1]), null, '\t'));" \
'{"key1":"value1","key2":"value2"}'
$ node -e "console.log(JSON.stringify(JSON.parse(require('fs') \
.readFileSync(process.argv[1])), null, 4));" myjson.json
@RichardHan
RichardHan / AES_sample_code
Created February 8, 2016 09:22
C# AES sample code
using System;
using System.IO;
using System.Security.Cryptography;
namespace AES
{
class Program
{
static string aes_key = "AXe8YwuIn1zxt3FPWTZFlAa14EHdPAdN9FaZ9RQWihc=";
static string aes_iv = "bsxnWolsAyO7kCfWuyrnqg==";
@RichardHan
RichardHan / js_dump
Last active February 2, 2016 03:24
JavaScript dump function
//http://www.openjs.com/scripts/others/dump_function_php_print_r.php
//http://stackoverflow.com/questions/749266/object-dump-javascript
(function() {
console.dump1 = function(object) {
if (window.JSON && window.JSON.stringify)
console.log(JSON.stringify(object));
else
console.log(object);
};
@RichardHan
RichardHan / developer-reading-list.md
Created December 20, 2015 15:35 — forked from oldratlee/developer-reading-list.md
关于我的“程序员必读书单”

@peng_gong程序员必读书单不错,核对了一下自己。

“读完”指从头到尾读完的;“读过”是指有读但中途放下了。
当然有些书是在自己年轻时读完的,当时阅历尚浅理解吸收有限,要再读! 😊

PS:
这里个人强调于区分“读完” vs. “读过”,是因为对于编程了解原则还远远不够,循环往复的理解操练是标配,按这个节奏打穿一本书的体系是开始也是过程。
个人觉得如果连“读完”好书建立书中的体系这样级别的磨练都不行,那路是不是走得着急了! 😄

PPS: 📚我的豆瓣读书

@RichardHan
RichardHan / Front-end-Developer-Interview-Questions-TC.md
Created November 22, 2015 21:31 — forked from hanksudo/Front-end-Developer-Interview-Questions-TC.md
Front-end-Developer-Interview-Questions - 前端工程師面試問題集(繁體中文版)

前端工程師面試問題集

@版本 2.0.0

譯注:此翻譯版,主要給不能流利的讀英文的人看,相關專有名詞還是保留原文。翻譯不好地方請協助pull request.

此repository包含了一些前端開發的面試問題,來審查一個有潛力的面試者。這並不是建議你對同一個面試者問上所有的問 (那會花費好幾小時)。從列表中挑幾個題目,應該就夠幫助你審查面試者是否擁有你需要的技能。

Rebecca MurpheyBaseline For Front-End Developers 也是一篇很棒且值得讀的文章在你開始面試之前。