Skip to content

Instantly share code, notes, and snippets.

View MagRelo's full-sized avatar

Matt Lovan MagRelo

View GitHub Profile
{
"generator-angular-fullstack": {
"generatorVersion": "3.3.0",
"endpointDirectory": "server/api/",
"insertRoutes": true,
"registerRoutesFile": "server/routes.js",
"routesNeedle": "// Insert routes below",
"routesBase": "/api/",
"pluralizeRoutes": true,
"insertSockets": true,
user nginx;
worker_processes {{ workers }};
error_log /var/log/nginx.log;
events {
worker_connections 1024;
accept_mutex off;
}
http {
/* 1 */
{
"result" : [
{
"_id" : "Sweet Tooth",
"count" : 2087.0000000000000000
},
{
"_id" : "Healthy",
"count" : 2069.0000000000000000
// -- Avoid excesive nesting
// -- Handle errors at the top of the function
// -- Be explicit about conditionals and name them
// ----
// ---- worse example
// ----
function worse(){
0x0dF897B2388A12694C2BF5CE1BE31825b0117302
{
"videoId" : "999",
"title" : "Radical Skateboard Video",
"needsUpdate" : false,
"inError" : false,
"active" : true,
"recordModified" : "2017-07-13T14:22:03.193Z",
"video" : {
"video_name" : "Radical Skateboard Video",
"video_id" : 999,
Verifying that "mattlovan.id" is my Blockstack ID. https://onename.com/mattlovan
0x7036B2Fc481951000a616B0447D07a454b6fb5E6
@MagRelo
MagRelo / Servesa_ABI.json
Created November 30, 2017 20:35
ABI for contract at 0x40f8Da2C9B078F6693D80BaC02182268E8B1779a
[{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"funders","outputs":[{"name":"exists","type":"bool"},{"name":"tokenCount","type":"uint256"},{"name":"totalPurchasePrice","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tokenBasePrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"contractStartTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"isFunderTokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"spend","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"isFunder","outputs":[{"name":"","ty
@MagRelo
MagRelo / component_snippet.jsx
Last active December 5, 2017 20:11
Load ethereum contract data into react state using web3
import React, { Component } from 'react'
import { Link } from 'react-router'
// JSON file that describe's the contract's metadata. Created during the contract 'compile' step.
import ExampleContract from '../../../build/contracts/example.json'
class FormComponent extends Component {
constructor(props) {
super(props)