Skip to content

Instantly share code, notes, and snippets.

View pengpengliu's full-sized avatar
🎯
Focusing

Liu Pengpeng pengpengliu

🎯
Focusing
View GitHub Profile
@pengpengliu
pengpengliu / BTCToken.sol
Created September 2, 2020 09:18
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.6+commit.6c089d02.js&optimize=false&gist=
// contracts/GLDToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.1.0/contracts/token/ERC20/ERC20.sol";
contract BTCToken is ERC20 {
constructor() public ERC20("Bitcoin", "BTC") {
uint256 initialSupply = 21000000000000000000000000;
_mint(msg.sender, initialSupply);
@pengpengliu
pengpengliu / 1_Storage.sol
Created July 13, 2020 06:09
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.11+commit.5ef660b1.js&optimize=false&gist=
pragma solidity >=0.4.22 <0.7.0;
/**
* @title Storage
* @dev Store & retreive value in a variable
*/
contract Storage {
uint256 number;
@pengpengliu
pengpengliu / 1_Storage.sol
Created July 13, 2020 03:36
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.6+commit.6c089d02.js&optimize=false&gist=
pragma solidity >=0.4.22 <0.7.0;
/**
* @title Storage
* @dev Store & retreive value in a variable
*/
contract Storage {
uint256 number;
# Xcode
.DS_Store
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
@pengpengliu
pengpengliu / iOS 8 UITableView separator
Last active August 29, 2015 14:15
iOS introduces the layoutMargins property on cells AND table views.
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
// Remove seperator inset
if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
[cell setSeparatorInset:UIEdgeInsetsZero];
}
// Prevent the cell from inheriting the Table View's margin settings
if ([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]) {
[cell setPreservesSuperviewLayoutMargins:NO];
@pengpengliu
pengpengliu / shadow
Created January 20, 2015 05:06
为View添加阴影
self.view.layer.shadowColor = [UIColor blackColor].CGColor;
self.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.view.bounds].CGPath;
self.view.layer.shadowOpacity = 0.6f;
self.view.layer.shadowOffset = CGSizeMake(0, -1);
self.view.layer.shadowRadius = 5.0f;
self.view.layer.masksToBounds = NO;
@pengpengliu
pengpengliu / installGhost.sh
Created December 17, 2014 01:17
One-Click Ghost Install Script for Ubuntu and CentOS
#!/bin/bash
# Written by Andy Boutte and David Balderston of howtoinstallghost.com and allaboutghost.com
# installGhost.sh will download and install all needed compontents to run Ghost
######Check to make sure script is being run as root######
if [[ `whoami` != root ]]; then
echo "This script must be run as root"
exit 1
fi
"set colortheme
"colorscheme autumn
"colorscheme blackboard
colorscheme asu1dark
"把gvim的菜单和工具栏隐藏掉,按F2可调出,再按隐藏
set guioptions-=m
set guioptions-=T
map <silent> <F2> :if &guioptions =~# 'T' <Bar>
syntax on
" set color theme
"colorscheme blackboard
"colorscheme busybee
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()