Skip to content

Instantly share code, notes, and snippets.

View thephucit's full-sized avatar

Thế Phúc thephucit

View GitHub Profile
- install https://metamask.io/
- kiem tien ether ao
- viet smartcontract https://remix.ethereum.org
- deploy
- copy address
- search by address
- public source
my address walet: 0x08D6b0891Ca9AEb6de1Ff78b04b02Ca41d1C44F9
pragma solidity 0.4.24;
contract Lottery
{
address public manager;
address[] public players;
constructor() public
{
manager = msg.sender;
@thephucit
thephucit / PushNotification.ts
Last active August 9, 2022 16:54
push notification typescript
import { consts } from '../config/consts';
import { global } from '../config/global';
import * as http from 'http';
import * as lo from 'lodash';
import {
UserDeviceTokenRepository
} from '../repositories/userDeviceTokenRepository';
export class PushNotification
@thephucit
thephucit / walksync.js
Created September 24, 2018 10:07 — forked from kethinov/walksync.js
List all files in a directory in Node.js recursively in a synchronous fashion
// List all files in a directory in Node.js recursively in a synchronous fashion
var walkSync = function(dir, filelist) {
var fs = fs || require('fs'),
files = fs.readdirSync(dir);
filelist = filelist || [];
files.forEach(function(file) {
if (fs.statSync(dir + file).isDirectory()) {
filelist = walkSync(dir + file + '/', filelist);
}
else {
@thephucit
thephucit / controller.php
Created October 16, 2018 02:46
Upload & management files for CKEditor
public function editorUpload(Request $request)
{
$validator = Validator::make($request->all(), [
'upload' => 'required|image|mimes:jpeg,png,jpg|max:2048',
]);
if ($validator->fails()) {
return response()->json([
'uploaded' => 0,
'error' => [
- xoá file ko cần thiết khi lỡ commit
```
git reset --soft HEAD~1
git reset HEAD [duong-dan-file-can-bo]
git commit -c ORIG_HEAD
```
- đưa code về lại commit
```
git reset --hard HEAD@{1}
ssh-keygen -t rsa -b 4096 -C "[email protected]"
export PATH=/bin:/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$PATH
export EDITOR='subl -w'
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
// 20181121191358
// https://raw.githubusercontent.com/thephucit/sublime-text/master/settings.json
{
"auto_indent": true,
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Theme - Flatland/Flatland Monokai.tmTheme",
"draw_white_space": "all",
"font_size": 12,
#!/bin/bash
apt-get install mysql-server
apt-get install php php-mysql
service nginx restart
mkdir /var/www/logs
sudo add-apt-repository -y ppa:ondrej/php\n
apt-get update
apt-get install php7.2 php7.2-cli php7.2-common