Skip to content

Instantly share code, notes, and snippets.

View shermanluong's full-sized avatar
💯
Focusing

Sherman Luong shermanluong

💯
Focusing
View GitHub Profile
@shermanluong
shermanluong / vault.sol
Created March 15, 2023 21:07
Vyper yearn-vault & Solidity code
// SPDX-License-Identifier: MIT
// Support string.concat
pragma solidity ^0.8.12;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"plugins": [
"@typescript-eslint",
"unused-imports",
"prettier"
@shermanluong
shermanluong / worktree-publish-to-gh-pages.md
Created June 4, 2021 04:44 — forked from lajlev/worktree-publish-to-gh-pages.md
Publishing a `dist` folder from `master` branch using **worktree** feature to `gh-pages` branch.

Setup

First of all, you need to have a gh-pages. If you don't have, create:

git branch gh-pages

This makes a branch based on the master HEAD. It would be okay but the files and the git history of master branch are not meaningful on gh-pages branch.

# db/migration/20181213024843_create_oauth_resource_owner.rb
# bundle exec rails generate CreateOauthResourceOwners -S
class CreateOauthResourceOwners < ActiveRecord::Migration
def change
create_table :oauth_resource_owners do |t|
t.string :owner_type
t.integer :owner_id
t.timestamps null: false
@shermanluong
shermanluong / gist:b89d2c8f945f618721122f330ce6cdad
Created December 8, 2018 17:04 — forked from eikes/gist:5a64b661022c756bd6522ed94770e2a6
List of Ruby on Rails Timezone names and their alias
["Africa/Algiers", "West Central Africa"],
["Africa/Cairo", "Cairo"],
["Africa/Casablanca", "Casablanca"],
["Africa/Harare", "Harare"],
["Africa/Johannesburg", "Pretoria"],
["Africa/Monrovia", "Monrovia"],
["Africa/Nairobi", "Nairobi"],
["America/Argentina/Buenos_Aires", "Buenos Aires"],
["America/Bogota", "Bogota"],
["America/Caracas", "Caracas"],
@shermanluong
shermanluong / Gist Obj to Array
Created September 5, 2018 19:18
Javascript object nest to array if there is childs
function objToArry(obj, ret=[]) {``
for(var key1 in obj){
ret.push(childToArray(obj[key1]))
}
return ret;
}
function childToArray(obj) {
if(JSON.stringify(obj['children']) === "{}")
obj['children'] = [];
@shermanluong
shermanluong / ORBTTOKEN
Created June 14, 2018 00:08
top1st orbttoken
pragma solidity ^0.4.4;
contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
@shermanluong
shermanluong / HEY-YOU.md
Created June 6, 2018 14:41 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
@shermanluong
shermanluong / Ubuntu 16.04 for Development.md
Created May 16, 2018 17:32 — forked from gerarldlee/Ubuntu 16.04 for Development.md
Development Setup on Ubuntu 16.04 Linux
@shermanluong
shermanluong / d3stryr-3stripes-atc-cs.php
Created April 28, 2017 13:42
Helper script for d3stryr-3stripes.php
<?php
set_time_limit(0);
$marketsList=[];
$marketsList['AT']='de_AT';
$marketsList['AU']='en_AU';
$marketsList['BE']='fr_BE';
$marketsList['BR']='pt_BR';
$marketsList['CA']='en_CA';
$marketsList['CL']='es_CL';