Skip to content

Instantly share code, notes, and snippets.

View suyanhanx's full-sized avatar
🥦

Suyan suyanhanx

🥦
  • Shanghai,China
  • 13:55 (UTC +08:00)
View GitHub Profile
/* * { color: blue !important; } */
/* 隐藏滚动条*/
.xterm .xterm-viewport::-webkit-scrollbar {
display: none;
}
@suyanhanx
suyanhanx / JobjectExtension.c#
Last active December 10, 2018 00:49
transform a JObject to a Dictionary ( for IDictionary/IEnumerable)
using System;
using System.Linq;
using System.Collections.Generic;
/// <summary>
/// JObject扩展
/// </summary>
public static class JObjectExtensions
{
@suyanhanx
suyanhanx / pack.js
Created November 13, 2018 07:52 — forked from Dafrok/pack.js
/**
* @file 在内存中打包 zip 文件的类,需要设置 `/var/run/${namespace}` 的权限为777
* @author o.o@mug.dog
*/
import * as fs from 'fs';
import * as path from 'path';
import * as mkdirp from 'mkdirp';
import * as archiver from 'archiver';
import * as copydir from 'copy-dir';
@suyanhanx
suyanhanx / pre-receive.go
Created October 28, 2018 02:45
a commit message check
package main
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"regexp"
"strings"
)
@suyanhanx
suyanhanx / eslint-pushed-changes.sh
Created October 20, 2018 01:35 — forked from stalniy/eslint-pushed-changes.sh
ESLINT + pre-receive git hook
#!/bin/bash
TEMPDIR=`mktemp -d`
ESLINTRC=$TEMPDIR/.eslintrc
COMMAND="eslint --color -c $ESLINTRC --rule 'import/no-unresolved: 0' --rule 'import/no-duplicates: 0' --rule 'import/export: 0'"
git show HEAD:.eslintrc > $ESLINTRC
echo "### Ensure changes follow our code style... ####"
# See https://www.kernel.org/pub/software/scm/git/docs/githooks.html#pre-receive
@suyanhanx
suyanhanx / eslint-pushed-changes.sh
Created October 20, 2018 01:35 — forked from stalniy/eslint-pushed-changes.sh
ESLINT + pre-receive git hook
#!/bin/bash
TEMPDIR=`mktemp -d`
ESLINTRC=$TEMPDIR/.eslintrc
COMMAND="eslint --color -c $ESLINTRC --rule 'import/no-unresolved: 0' --rule 'import/no-duplicates: 0' --rule 'import/export: 0'"
git show HEAD:.eslintrc > $ESLINTRC
echo "### Ensure changes follow our code style... ####"
# See https://www.kernel.org/pub/software/scm/git/docs/githooks.html#pre-receive
@suyanhanx
suyanhanx / goyd.go
Last active August 2, 2018 01:36
a youdao cli (fork from sofish/goyd) 有道翻译命令行工具(英文)
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
"os/exec"
"strings"