Skip to content

Instantly share code, notes, and snippets.

/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
pragma solidity ^0.4.25;
contract Election {
address owner; // Address of the contract owner
bool public isVoting = false; // isVoting should be true when voting starts
uint public round = 0; // round number should be increased when new election starts
struct Candidate {
uint vote;
@marxwang
marxwang / 1_kubernetes_on_macOS.md
Created December 9, 2017 05:18 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@marxwang
marxwang / vagrant-cheat-sheet.md
Created November 10, 2016 08:32 — forked from wpscholar/vagrant-cheat-sheet.md
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Common Vagrant Commands

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
  • vagrant status -- outputs status of the vagrant machine
  • vagrant halt -- stops the vagrant machine
  • vagrant reload -- restarts vagrant machine, loads new Vagrantfile configuration
  • vagrant provision -- forces reprovisioning of the vagrant machine
@marxwang
marxwang / vm-resize-hard-disk.md
Created January 20, 2016 10:29 — forked from christopher-hopper/vm-resize-hard-disk.md
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

# Type(<scope>): <subject>
# <body>
# <footer>
# Type should be one of the following:
# * feat (new feature)
# * fix (bug fix)
# * docs (changes to documentation)
@marxwang
marxwang / gist:a99428493567ff548b3a
Created October 19, 2015 03:55
自來水公司各區主要淨水站彙整表連結PDF
/**
* 各淨水站說明,內含水質檢測元素分析結果
* 資料來源:臺水網頁 用水宣導 http://www.water.gov.tw/05know/kno_b_main.asp?bull_id=1264
* 文件內有水質品質檢測 (時間?定期更新?)
*/
http://www.water.gov.tw/files/MyWater/pdf/蘭潭淨水場風情定稿.pdf
http://www.water.gov.tw/files/MyWater/pdf/新山淨水場風情定稿.pdf
http://www.water.gov.tw/files/MyWater/pdf/公園淨水場風情定稿.pdf
http://www.water.gov.tw/files/MyWater/pdf/貢寮淨水場風情定稿.pdf
# PHP #
###下載 原始碼
$ wget http://tw2.php.net/distributions/php-5.3.8.tar.gz
$ wget http://xmlsoft.org/sources/libxml2-2.7.7.tar.gz
$ wget http://zlib.net/zlib-1.2.5.tar.gz
###解壓縮
cd /tmp; mkdir openssl; cd openssl;
wget https://www.openssl.org/source/openssl-1.0.0o.tar.gz
tar -zxf openssl-1.0.0o.tar.gz
cd openssl-1.0.0o
./config
make
make install