Skip to content

Instantly share code, notes, and snippets.

View sohkai's full-sized avatar

Brett Sun sohkai

View GitHub Profile
@sohkai
sohkai / gist:5c8f862b4496b41dc681
Last active October 2, 2017 15:14
Javascript URL Regex
\b(https?:\/\/)?((?:www\.)?((?:[^\s.,;()\/]+\.)+[^\s$_!*()$&.,;=?+\/\#]+)((?:\/|\?|\/\?)[^\s#^`{}<>?"\[\]\/\|]+)*\/?(#[^\s#%^`{}<>?"\[\]\/\|]*)?)
/**
* Should be used with /i flag as well as the /g flag if looking for multiple matches
*
* Notes:
* Ignores schemes other than http(s).
* Captures emails as otherwise it would match the `gmail.com` in `hi@gmail.com`,
* producing (what I think is) more surprising behaviour than the alternative.
*
@sohkai
sohkai / cvim.rc
Last active May 11, 2016 13:28
cVim.rc
" Scroll settings
unmap e s w " Unmap extra scroll bindings
map ^ scrollToLeft
" Misc settings
unmap r zr gR cr " Unmap reload bindings
unmap ge gd " Unmap downloads and extension pages
" Tab settings
unmap gt K R gT J E " Just use <C-h> and <C-l> to navigate tabs
@sohkai
sohkai / keybase.md
Created August 9, 2016 20:07
Keybase identity

Keybase proof

I hereby claim:

  • I am sohkai on github.
  • I am sohkai (https://keybase.io/sohkai) on keybase.
  • I have a public key whose fingerprint is AA21 0DD3 65CF 1176 1168 D83D 274F EB9E 9F9A 9A14

To claim this, I am signing this object:

@sohkai
sohkai / workshop-1.md
Last active July 18, 2018 13:10
Dapp UX Workshop #1

Dapp UX Workshop #1

  • Goals:
    • Investigate aragon-ui and whether the Giveth Dapp could use it in the future
      • The Dapp will be redesigned soon, would be great to collaborate on the redesign
  • aragon-ui
    • Meant to be fully generic UI toolkit, hopefully widely adopted even outside of the blockchain space
      • There will be some ethereum-specific UI components (e.g. addresses, components for optimistic transaction UIs) so the community doesn't have to keep solving the same problems
      • General design strategies and guidelines for both blockchain and non-blockchain specific use cases

Aragon <> Zeppelin Package Management

  • Aragon Package Manager
    • Constraints on Repos?
      • Currently only one contract address and one content URI available per version in a Repo
        • Changing the contract address is more dangerous than a content URI change, so it's only possible to change it via major versions (checked on chain)
    • Number of deployed repos?
      • 10 < x < 100
    • Does aragonOS use the package manager?
  • Not directly on chain; our upgradability architecture is based on the organization installing their preferred versions vs. relying on the package manager
@sohkai
sohkai / stylus_github.css
Created August 3, 2018 12:46
stylus - Github
body,
.markdown-body,
.tooltipped::after {
font-family: Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol' !important;
}
body {
font-size: 13px !important;
line-height: 1.4 !important;
}
@sohkai
sohkai / survey-kit.json
Created August 13, 2018 22:45
Survey Kit ABI
[
{
"constant": true,
"inputs": [],
"name": "APM_NODE",
"outputs": [
{
"name": "",
"type": "bytes32"
}
@sohkai
sohkai / create-survey-dao.md
Last active August 13, 2018 22:53
New Survey DAO

Creating a new Survey DAO on mainnet (by hand)

First: you must have a pre-existing Minime token already deployed to mainnet.

Creating a DAO

To create a DAO with the Survey app installed, you can send a transaction to our Survey DAO factory (0xb5ba20a4e9167b640311a0c10d773bb143db5e39), calling newInstance().

If you look at the tx we used to create our (Aragon) DAO: https://etherscan.io/tx/0xcff32cd339f3ea7d41f31577d57a0dd3bc4db228e3f9b7ebc4bcdba28503fb1f, you can take the input data and change a few areas:

  • Replace 960b236a07cf122663c4303350609a66a7b288c0 (ANT token) with your-minime-token-address
[
"./coverageEnv/app/node_modules/@aragon/apps-finance/contracts/Finance.sol",
"./coverageEnv/app/node_modules/@aragon/apps-finance/test/mocks/ExecutionTarget.sol",
"./coverageEnv/app/node_modules/@aragon/apps-finance/test/mocks/FinanceMock.sol",
"./coverageEnv/app/node_modules/@aragon/apps-finance/test/TestFinance.sol",
"./coverageEnv/app/node_modules/@aragon/apps-vault/contracts/connectors/ERC20Connector.sol",
"./coverageEnv/app/node_modules/@aragon/apps-vault/contracts/connectors/ERC721Connector.sol",
"./coverageEnv/app/node_modules/@aragon/apps-vault/contracts/connectors/ERC777Connector.sol",
"./coverageEnv/app/node_modules/@aragon/apps-vault/contracts/connectors/ETHConnector.sol",
"./coverageEnv/app/node_modules/@aragon/apps-vault/contracts/connectors/standards/ERC721.sol",
@sohkai
sohkai / EVMScriptRegistryFactory_07.sol
Created December 5, 2019 16:26
Aragon 0.7 - EVMScriptRegistryFactory
// See https://etherscan.io/address/0x1630b381219984eb3a1206261b4add2ccef4de5c#code
/**
*Submitted for verification at Etherscan.io on 2019-04-16
*/
// File: contracts/evmscript/IEVMScriptExecutor.sol
/*
* SPDX-License-Identitifer: MIT