Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
.zZ

Richard Liu lzl124631x

💻
.zZ
View GitHub Profile
View config1
compiling ...
launching beacon chain ...
INFO [12-08|23:40:02.301771] connecting to beacon chain now ...
INFO [12-08|23:40:03.314806] connecting to beacon chain now ...
INFO [12-08|23:40:04.328916] connecting to beacon chain now ...
INFO [12-08|23:40:05.339338] connecting to beacon chain now ...
INFO [12-08|23:40:06.353002] connecting to beacon chain now ...
INFO [12-08|23:40:07.307683] Shard information obtained ..
INFO [12-08|23:40:07.366782] connecting to beacon chain now ...
INFO [12-08|23:40:08.316918] Shard information obtained ..
View config1, p2pv1
DEBUG[12-04|20:58:52.252161] Starting server node="[duty:VLD, priKey:bff3000000000000000000000000000000000000000000000000000000000000, ShardID:0, nodeID:62399, state:Finished]" ip=127.0.0.1 port=9007
INFO [12-04|20:58:52.252882] support_sycning: StartSyncingServer on port: port=8007
DEBUG[12-04|20:58:52.329352] Starting server node="[duty:VLD, priKey:bdf3000000000000000000000000000000000000000000000000000000000000, ShardID:0, nodeID:62397, state:Finished]" ip=127.0.0.1 port=9005
INFO [12-04|20:58:52.33018] support_sycning: StartSyncingServer on port: port=8005
DEBUG[12-04|20:58:52.436496] Starting server node="[duty:VLD, priKey:bbf3000000000000000000000000000000000000000000000000000000000000, ShardID:0, nodeID:62395, state:Finished]" ip=127.0.0.1 port=9003
INFO [12-04|20:58:52.437773] support_sycning: StartSyncingServer on port: port=8003
DEBUG[12-04|20:58:52.460597] Starting server node="[duty:VLD, priKey:c1f3
@lzl124631x
lzl124631x / delete-branches.js
Last active Nov 29, 2018
Delete Useless Github Remote Branches
View delete-branches.js
// 1. Go to Github Branches Page
// 2. Open Chrome Dev Tool Console (F12)
// 3. Paste this command into the console and run.
// 4. Paste your clipboard in bash command line and run.
copy('git push origin --delete ' + $$('a.branch-name').map(x => x.textContent).join(' '))
View add_markdown_to_mongodb.js
use admin
files = ls();
files.forEach((file) => {
regex=/\.\/(.*)\.md/g
parts=regex.exec(file)
if (parts == null) return
title=parts[1]
print(title)
content=cat(file)
print(content)
@lzl124631x
lzl124631x / droplet.css
Created Aug 14, 2016
CSS 3 Water Droplet
View droplet.css
.droplet {
width: 1em;
height: 1em;
border-radius: 80% 0 55% 50% / 55% 0 80% 50%;
background-color: #07C;
transform: rotate(-45deg);
}
@lzl124631x
lzl124631x / js
Created Aug 14, 2016
get percentage css value from element
View js
$.fn.pureCss = function (css) {
var $dummy = this.parent().clone().appendTo('body').hide();
var ret = $dummy.find(this.selector).css(css);
$dummy.remove();
return ret;
};
@lzl124631x
lzl124631x / js
Last active Aug 11, 2016
keep element's ratio
View js
// http://codepen.io/lzl124631x/pen/xOmJGE
$.fn.keepRatio = function(ratio) {
var self = this,
$p = this.parent(),
keep = function() {
var w = $p.width(),
h = $p.height();
if (w / h > ratio) {
self.height(h);
self.width(h * ratio);
@lzl124631x
lzl124631x / html
Last active Jun 5, 2016
Html Meta: App Mode -- Not Scallable
View html
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0">
View gist:79f502cd4fa70d2637f5169baf8b0a86
String.prototype.toUnicode = function(){
var result = "";
for(var i = 0; i < this.length; i++){
result += "\\u" + ("000" + this[i].charCodeAt(0).toString(16)).substr(-4);
}
return result;
};
"みどりいろ".toUnicode(); //"\u307f\u3069\u308a\u3044\u308d"
"Mi Do Ri I Ro".toUnicode(); //"\u004d\u0069\u0020\u0044\u006f\u0020\u0052\u0069\u0020\u0049\u0020\u0052\u006f"
@lzl124631x
lzl124631x / js
Created May 25, 2016
get parameter in query string by name
View js
function getParameterByName (name) {
var undefined;
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? undefined : decodeURIComponent(results[1].replace(/\+/g, " "));
};
You can’t perform that action at this time.