Skip to content

Instantly share code, notes, and snippets.

View HenryNguyen5's full-sized avatar
🎯
Focusing

HenryNguyen5

🎯
Focusing
View GitHub Profile
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
import EthApi from './eth-api'
import store from '../store'
import * as actionCreator from '../actions/proj-actions'
import Utils from './api-helpers'
const loadAppState = async () => {
const ethApi = new EthApi()
console.log('Loading and deploying contracts')
await ethApi.loadContracts()
await ethApi.deployContract({
_contract: EthApi.projResolver,
0x5732f471a5408C69E99a49F38Cb4C0Bce0830cE6
@HenryNguyen5
HenryNguyen5 / ABIFunction.js
Created September 5, 2017 23:12
ABI Function parser that maps an ABI function to an object that contains call and decode methods, and allows for run-time checking/parsing of given arguments
import abi from 'ethereumjs-abi';
class AbiFunction {
constant;
inputs;
name;
outputs;
payable;
type;
methodInputTypes;
const JSONPostParser = (parser = null) => ({ result }) =>
parser && typeof parser === 'function' ? parser(result) : result;
const JSONErrorHandler = (handler = null) => e => {
if (handler && typeof handler === 'function') {
return handler(e);
} else {
throw Error(e.message);
}
class Node {
currentNodeConfig
currentNetworkConfig;
networkConfigs;
nodeConfigs;
constructor(configs) {
Object.assign(this, ...configs);
import React, { Component } from 'react';
import NewTabLink from 'components/ui/NewTabLink';
interface RequiredProps {
conditional: boolean;
conditionalProps: {
[key: string]: any;
};
}
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest Tests",

Keybase proof

I hereby claim:

  • I am henrynguyen5 on github.
  • I am henrynguyen5 (https://keybase.io/henrynguyen5) on keybase.
  • I have a public key ASCuLYXta7t_PIVaBrvQ4wHIf89s_Y5-abOZe_mO8NBJ7go

To claim this, I am signing this object:

@HenryNguyen5
HenryNguyen5 / gist:e4d88596f59738a991da5adc15877f8e
Created April 3, 2018 23:15
alias-resolver for path-alias-resolver package
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const { resolvePath } = require('babel-plugin-module-resolver');
class AliasResolver {
constructor(root, aliases = {}) {
this.aliases = {};
this.rule = /(?:require|import)[^'"]*(?:'|")([^'"]*)(?:'|")/g;
this.parseLine = (line, filePath) => {
const transformedLine = line.replace(this.rule, (substr, moduleId) => {
// console.log('matched ', line);