Skip to content

Instantly share code, notes, and snippets.

@luckyyang
luckyyang / fomo.sol
Created November 6, 2018 09:19 — forked from hayeah/fomo.sol
fomo3d contract
pragma solidity ^0.4.24;
/**
* @title -FoMo-3D v0.7.1
* ┌┬┐┌─┐┌─┐┌┬┐ ╦╦ ╦╔═╗╔╦╗ ┌─┐┬─┐┌─┐┌─┐┌─┐┌┐┌┌┬┐┌─┐
* │ ├┤ ├─┤│││ ║║ ║╚═╗ ║ ├─┘├┬┘├┤ └─┐├┤ │││ │ └─┐
* ┴ └─┘┴ ┴┴ ┴ ╚╝╚═╝╚═╝ ╩ ┴ ┴└─└─┘└─┘└─┘┘└┘ ┴ └─┘
* _____ _____
* (, / /) /) /) (, / /) /)
* ┌─┐ / _ (/_ // // / _ // _ __ _(/
* ├─┤ ___/___(/_/(__(_/_(/_(/_ ___/__/_)_(/_(_(_/ (_(_(_
@luckyyang
luckyyang / Lisk blockchain database structure.md
Created January 21, 2018 16:39 — forked from andreafspeziale/Lisk blockchain database structure.md
Lisk blockchain platform PostgreSQL database structure description

Lisk blockchain database structure

Lisk is a blockchain application platform and crypto-currency, which offers an all round solution for Node.js and JavaScript developers to deploy their own blockchain applications.

You can find a very nice documentation about Lisk here but some useful iformation like the complete database structure are missing.

This gist aims at telling you more about where the Lisk blockchain is stored. The following notes are taken from the study of Lisk testnet 0.9.3a version.

Database

@luckyyang
luckyyang / gist:42a91d92953c85753c98
Created November 22, 2015 05:08 — forked from xigua/gist:e8adc26a3b943570a18d
Mongodb 3.0 Replica Set Setup with Docker Notes
Reference: https://medium.com/@gargar454/deploy-a-mongodb-cluster-in-steps-9-using-docker-49205e231319#.ff9lbtdl9
this post talks about 3 Nodes,Mongodb 2.6.5. In order to use mongo 3.0, a few changes has been made. Assume using root
1. First we need 2 servers with docker installed
1.1 recommend use Ubuntu 14.04 on aliyun, then install daocloud for docker installation and monitoring
curl -sSL https://get.daocloud.io/docker | sh
1.2 install daocloud monitoring program
## FILL ##
fill Sets fill color of the shape.
fill-opacity Sets fill opacity of the shape.
fill-rule Sets fill rule of the shape.
** example **
fill: #ccc;
fill: rgba(0,0,0,.5);
fill: red;
@luckyyang
luckyyang / d3.md
Created November 8, 2013 01:59 — forked from tmcw/d3.md

This is a more wordy, narrative accompaniment to my pretty bare presentation about d3 that I gave to the jQuery DC Meetup.

What is d3?

  • Not a chart library (though you can make charts with it)
  • Not a map library (though you can make maps with it)

Which is to say, d3 can be used for building things, but the 'atomic parts' are lower-level than bar graphs or projections or so on. This is a powerful fact. It also means that d3 is a good basis for simple interfaces, like Vega.js, that make its power accessible in other ways.

  • Not a compatibility layer (it doesn't work with bad browsers)
#################################
#
# 本清单基于 ubuntu 12.04,
# 下个 ubuntu 的 LTS
# 发出来后,会相应更新这里的内容。我的目标是按步执行可以零错误完成安装。
# 注意,本文件只是一个清单,不是一个可以安全执行的脚本
#
#################################
# create a linode,login as root, and create a common user for all the tasks

Render and Redirect

The normal controller/view flow is to display a view template corresponding to the current controller action, but sometimes we want to change that. We use render in a controller when we want to respond within the current request, and redirect_to when we want to spawn a new request.

Render

The render method is very overloaded in Rails. Most developers encounter it within the view template, using render :partial => 'form' or render @post.comments, but here we'll focus on usage within the controller.

:action