Skip to content

Instantly share code, notes, and snippets.

:octocat:
I may be slow to respond.

Darkness navono

:octocat:
I may be slow to respond.
Block or report user

Report or block navono

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
@navono
navono / jsonParser.sh
Created May 21, 2019
parse json with jq in shell
View jsonParser.sh
// {
// "sync": true,
// "machines": [
// {
// "name": "1911-1",
// "address": "192.168.1.14",
// "user": "administrator",
// "passwd": "supcon_1",
// "path": "C:\\AppDev"
// },
@navono
navono / dockertags
Created Apr 22, 2019
获取指定镜像的所有 tag
View dockertags
#!/bin/bash
if [ $# -lt 1 ]
then
cat << HELP
dockertags -- list all tags for a Docker image on a remote registry.
EXAMPLE:
- list all tags for ubuntu:
@navono
navono / introrx.md
Created Mar 26, 2019 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
View introrx.md
@navono
navono / README.md
Created Mar 18, 2019 — forked from roachhd/README.md
EMOJI cheatsheet 😛😳😗😓🙉😸🙈🙊😽💀💢💥💏👫👄👃👀👛👛🗼🔮🔮🎄🎅👻
View README.md

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. ✈ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: 😄

@navono
navono / etcd3-demo.go
Created Mar 15, 2019
A demo for etcd3 golang client
View etcd3-demo.go
package main
import (
"context"
"fmt"
"log"
"strconv"
"time"
"github.com/coreos/etcd/clientv3"
View gist:1b97f623087184bbdea279478d791488
  • What do Etcd, Consul, and Zookeeper do?
    • Service Registration:
      • Host, port number, and sometimes authentication credentials, protocols, versions numbers, and/or environment details.
    • Service Discovery:
      • Ability for client application to query the central registry to learn of service location.
    • Consistent and durable general-purpose K/V store across distributed system.
      • Some solutions support this better than others.
      • Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
      • Centralized locking can be based on this K/V store.
@navono
navono / protoInstall.sh
Created Dec 10, 2018
Install proto in ubuntu
View protoInstall.sh
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip
# Unzip
unzip protoc-3.6.1-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
@navono
navono / jsonParser.bat
Last active May 21, 2019
parse JSON file by windows batch
View jsonParser.bat
:: Read file "package.json" into variable string, removing line breaks.
set string=
for /f "delims=" %%x in (package.json) do set "string=!string!%%x"
rem Remove quotes
set string=%string:"=%
rem Remove braces
set "string=%string:~2,-2%"
rem Change colon+space by equal-sign
set "string=%string:: ==%"
@navono
navono / parsePathData.js
Created Nov 16, 2018
Canvas path render with pathdata
View parsePathData.js
define(function (require) {
// come from https://github.com/konvajs/konva/blob/3cfb57681201271b1d71eea8416557d0e5ace8ac/src/shapes/Path.js
function getLineLength(x1, y1, x2, y2) {
return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
};
function getPointOnCubicBezier(
pct,
P1x,
@navono
navono / react-resizable.d.ts
Created Sep 28, 2018
A demo declaration file of react-resizable
View react-resizable.d.ts
declare module 'react-resizable' {
import * as React from 'react';
type Axis = 'both' | 'x' | 'y' | 'none';
type ResizeCallbackData = {
node: HTMLElement,
size: {width: number, height: number}
};
interface IResizableProps {
You can’t perform that action at this time.