Skip to content

Instantly share code, notes, and snippets.

View ngocbd's full-sized avatar
🎯
Focusing

Bui Dinh Ngoc ngocbd

🎯
Focusing
View GitHub Profile
import zlib
import base64
import functools
import math
def memo(f):
table = {}
def fmemo(*args):
if args not in table:
table[args] = f(*args)
@ngocbd
ngocbd / up.php
Created September 25, 2016 12:24
<?php
$target_path = "";
$target_path = $target_path . basename( $_FILES['f']['name']);
if(move_uploaded_file($_FILES['f']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['f']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
0xd05578bf5bf8Bb101db09C08dc60bA4544cf46e0
@ngocbd
ngocbd / ssss
Created October 25, 2017 08:35
0x81004e5c1878a081a841c5813e444903adc8bdcd
0x9511534E35DE7e8c15E8E33BDd9B5140f32B0125
@ngocbd
ngocbd / gist:b0abec02959dc1ac9463c7624509dbf9
Created June 14, 2018 03:40
call smartcontract by web3js
// Dependencies
var Web3 = require('web3');
var Tx = require('ethereumjs-tx');
var _ = require('lodash');
var SolidityFunction = require('web3/lib/web3/function');
var keythereum = require("keythereum");
// Initialize connection
var web3 = new Web3();
web3.setProvider(new web3.providers.HttpProvider("http://localhost:8545"));
@ngocbd
ngocbd / keybase.md
Created August 15, 2018 10:50
keybase.md

Keybase proof

I hereby claim:

  • I am ngocbd on github.
  • I am ngocbd (https://keybase.io/ngocbd) on keybase.
  • I have a public key whose fingerprint is FC62 4803 725D 27A9 FD42 81F7 B7C1 D5E9 2D16 B4F4

To claim this, I am signing this object:

String[] commentRepo = {
"Bài nói của bạn rất hay %s. Mình đã đăng bài viết của bạn tại https://cec.net.vn/p/%s/",
"%s bài nói của bạn rất hay. Mình đã đăng bài viết của bạn tại https://cec.net.vn/p/%s/",
"%s bài nói của bạn rất tuyệt vời. Mình đã đăng bài viết của bạn tại https://cec.net.vn/p/%s/",
"%s mình tự hào về bạn. Mình đã đăng bài viết của bạn tại https://cec.net.vn/p/%s/",
"%s ước gì mình nói được như bạn bạn. Mình đã đăng bài viết của bạn tại https://cec.net.vn/p/%s/",
"Mình tự hào về bạn. %s mình đã đăng bài viết của bạn tại https://cec.net.vn/p/%s/",
"%s thần tượng của mình đây rồi, mình đã đăng bài viết của bạn tại https://cec.net.vn/p/%s/",
"%s quá hay mình đã đăng bài viết của bạn tại https://cec.net.vn/p/%s/",
"%s Quá tuyệt mình đã đăng bài viết của bạn tại https://cec.net.vn/p/%s/",
/****************************************************************************
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
/* YourDuino.com Example Software Sketch
20 character 4 line I2C Display
Backpack Interface labelled "YwRobot Arduino LCM1602 IIC V1"
Connect Vcc and Ground, SDA to A4, SCL to A5 on Arduino
terry@yourduino.com */
/*-----( Import needed libraries )-----*/
#include <Wire.h> // Comes with Arduino IDE
// Get the LCD I2C Library here:
// https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads