Skip to content

Instantly share code, notes, and snippets.

View lokialice's full-sized avatar
🎯
Focusing

Hoàng Phi lokialice

🎯
Focusing
View GitHub Profile

Github Actions là gì?

  • Github Actions cho phép chúng ta tạo workflows vòng đời phát triển phần mềm cho dự án trực tiếp trên Github repository của chúng ta

  • Github Actions giúp chúng ta tự động hóa quy trình phát triển phần mềm tại nơi chúng ta lưu trữ code và kết hợp với pull request và issues. Chúng ta có thể viết các tác vụ riêng lẻ, được gọi là các actions và kết hợp các actions đó lại với nhau để tạo ra một workflow theo ý của chúng ta. Workflow là các tiến trình tự động mà bạn có thể thiết lập trong repository của mình để build, test, publish package, release, hoặc deploy dự nào trên Github

  • Với Github Actions chúng ta có thể tích hợp continuous integration (CI) và continuous deployment (CD) trực tiếp trên repository của mình

// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.8.0;
pragma experimental ABIEncoderV2;
contract Wallet {
address[] public approvers;
uint8 public quorum;
struct Transfer {
import TronWeb from 'tronweb'
interface JustSwap {
tokenToTrxSwapInput(tokens_sold: number, min_trx: number, deadline: number): { send(any) }
getTokenToTrxInputPrice(tokens_sold: number): {call()}
tokenToTrxTransferInput(min_liquidity: number, max_tokens: number, deadline: number, recipient: string): { send(any) }
tokenToTokenSwapInput(tokens_sold: number, min_tokens_bought: number, min_trx_bought: number, deadline: number, token_addr: string): { send(any) }
};
stages:
- deploy development
- deploy production
deploy_dev_stage:
stage: deploy development
environment:
name: deploying
only:
- develop
@lokialice
lokialice / MANUAL.md
Created March 16, 2020 14:30 — forked from kimyvgy/MANUAL.md
Deploy nodejs app with gitlab.com and pm2

Deploy nodejs app with gitlab.com and pm2

This manual is about setting up an automatic deploy workflow using nodejs, PM2, nginx and GitLab CI. It is tested on:

  • Target server: Ubuntu 16.04 x64. This is suitable for Ubuntu 14.x.
  • Windows 10 on my PC to work.
@lokialice
lokialice / app.js
Created June 21, 2017 04:09
how to get a user input in google maps using custom controls?
function initialize() {
var myMapOptions = {
zoom: 8,
center: new google.maps.LatLng(-34.397, 150.644),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById('map_canvas'), myMapOptions);
// Create a div to hold everything else
var controlDiv = document.createElement('DIV');
@lokialice
lokialice / delegate
Created June 8, 2017 11:38
delegate in c#
Action is a delegate (pointer) to a method, that takes zero, one or more input parameters, but does not return anything.
Func is a delegate (pointer) to a method, that takes zero, one or more input parameters, and returns a value (or reference).
Predicate is a special kind of Func often used for comparisons.
Though widely used with Linq, Action and Func are concepts logically independent of Linq. C++ already contained the basic concept in form of typed function pointers.
Here is a small example for Action and Func without using Linq:
@lokialice
lokialice / default.aspx
Last active March 7, 2017 05:05
call ajax in asp.net webforms
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="DemoPhoneBook.demo._default" %>
<style>
table, th, td {
border: 1px solid black;
}
</style>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
@lokialice
lokialice / countries.sql
Created March 1, 2017 04:14 — forked from adhipg/countries.sql
Sql dump of all the Countries, Country Codes, Phone codes.
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;