Skip to content

Instantly share code, notes, and snippets.

View nhancv's full-sized avatar
🏠
Working from home

Nhan Cao nhancv

🏠
Working from home
View GitHub Profile
@nhancv
nhancv / NCToken.sol
Last active October 30, 2021 12:32
Nhan Cao token
pragma solidity 0.4.21;
/**
Nhancv token contract
Contract address: https://ropsten.etherscan.io/address/0x9291b8194962bdaff76521358274900ae0d0f2ae#code
Token address : https://ropsten.etherscan.io/token/0x9291b8194962bdaff76521358274900ae0d0f2ae
Deployed at : 0x9291b8194962bdaff76521358274900ae0d0f2ae
Symbol : NC
Name : Nhan Cao Token
@nhancv
nhancv / Voting.sol
Created March 27, 2018 08:27
Voting application
pragma solidity 0.4.21;
contract Voting {
// @nhancv: Define candidate
struct Candidate {
uint8 id;
string name;
uint8 point;
@nhancv
nhancv / NKemICO.sol
Created March 27, 2018 10:54
NKem ICO Crowdsale simple
pragma solidity 0.4.21;
/**
ICO CrowdSale token contract
Abstract
Start date : Tuesday, March 27, 2018 5:31:11 PM GMT+07:00
Bonus end date : Wednesday, March 27, 2019 5:31:11 PM GMT+07:00
End date : Thursday, March 26, 2020 5:31:11 PM GMT+07:00
Normal price : 100 NKEM Tokens per 1 ETH
@nhancv
nhancv / main.dart
Last active April 4, 2018 05:06
Tab Indicator simple
import 'dart:math';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter/animation.dart';
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
@nhancv
nhancv / demo2.dart
Last active April 10, 2018 21:09
Curves simulation
import 'dart:async';
import 'dart:ui' as ui;
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter/animation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart' show timeDilation;
class DemoPage extends StatefulWidget {
@override
@nhancv
nhancv / demo3.dart
Last active April 6, 2018 02:32
Simple particle motion
import 'dart:math';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter/animation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart' show timeDilation;
class DemoPage extends StatefulWidget {
@override
_DemoPageState createState() => new _DemoPageState();
@nhancv
nhancv / dartpros.dart
Created April 11, 2018 05:31
High light in Dart
import 'dart:async';
class April {
// Public by default, private by prefixing “_”
int publicInt = 2;
int _privateInt = 2;
// Collection literals
void collectionLiterals() {
print([1, 2, 3, 4]);
@nhancv
nhancv / quadraticbezier.dart
Last active April 22, 2018 11:14
Bezier function
Offset getQuadraticBezier(List<Offset> offsetList, double t,
{Canvas canvas, Paint paint}) {
return getQuadraticBezier2(
offsetList, t, 0, offsetList.length - 1, canvas, paint);
}
Offset getQuadraticBezier2(List<Offset> offsetList, double t, int i, int j,
Canvas canvas, Paint paint) {
if (i == j) return offsetList[i];
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip
# Unzip
unzip protoc-3.2.0-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/
@nhancv
nhancv / install_labelImg_macos.sh
Created May 9, 2018 18:14
Install labelImg on macOS High Sierra
#!/bin/sh
brew install python@2
pip install --upgrade virtualenv
# clonde labelimg source
rm -rf /tmp/labelImgSetup
mkdir /tmp/labelImgSetup
cd /tmp/labelImgSetup
curl https://codeload.github.com/tzutalin/labelImg/zip/master --output labelImg.zip