Skip to content

Instantly share code, notes, and snippets.

View ambethia's full-sized avatar
🐼
PANDAS!

Jason L Perry ambethia

🐼
PANDAS!
View GitHub Profile

neo-gql

A GraphQL blockchain explorer API

  • Initial transfer of repo to CityOfZion
  • Improved blockchain syncing, no longer requires separate worker process
  • Added Dockerfile and docker-compose configurations
  • Added partial (~75% complete) emulation of neon-wallet-db REST API
  • Fixed some bugs with account balances
require 'openssl'
module Neo
class Key
ADDRESS_VERSION = '17'
PUSHBYTES33 = '21'
CHECKSIG = 'ac'
WIF_PREFIX = '80' # MainNet
WIF_SUFFIX = '01' # Compressed
const item = 'FOOBerries!'
// Anti-pattern, don't do this!
this.state.list.push(item)
this.setState({ list: this.state.list })
// Correct way to do what the anti-pattern did:
const nextState = this.state.list.slice()
nextState.push(item)
this.setState({ list: nextState })
@ambethia
ambethia / prettier.md
Created July 12, 2017 19:08
Installing Prettier in Atom

We're going to use the official Atom package for Prettier to help us make our code... prettier.

Go to Settings → Install and search for prettier-atom. Remember the keyboard shortcut to bring up settings is ⌘,. Click Install.

Once it's done install, you can click on the Settings button under prettier-atom. The following settings are reccomended:

  • Format files on Save: Yes
  • Show in Status Bar: Yes, this gives you a quick toggle for enabling and disabling auto formatting on save at the bottom of your Atom window.
import React, { Component } from 'react'
import { withRouter } from 'react-router-dom'
class SearchField extends Component {
_submit = (event) => {
event.preventDefault()
const query = this.refs.query.value
const path = query.length > 0 ? `/search/${query}` : '/'
// This is the kicker... it redirects us to /search/foo.
@ambethia
ambethia / App.js
Created April 10, 2017 05:12
A simple React counter.
import React, { Component } from 'react'
class App extends Component {
state = {
count: 0
}
_click = () => {
this.setState({
count: this.state.count + 1
@ambethia
ambethia / index.html
Last active March 28, 2017 16:18
One List Starter Kit
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>One List</title>
<link href="https://fonts.googleapis.com/css?family=Neucha|Comfortaa:300" rel="stylesheet" type="text/css">
<!-- <link rel="stylesheet" href="main.css" media="screen" title="no title" charset="utf-8"> -->
</head>
<body>
@ambethia
ambethia / Dockerfile
Created January 16, 2017 18:09
Notes on Docker+Heroku
FROM node
ENV NODE_ENV production
WORKDIR /usr/src/app
RUN curl -o- -L https://yarnpkg.com/install.sh | bash
ENV PATH /root/.yarn/bin:$PATH
COPY package.json yarn.lock migrations index.js ./
RUN yarn
@ambethia
ambethia / memory.txt
Last active December 11, 2016 20:50
Pseudocode to describe a game of memory.
faces = [🤖, 🐢, 🐼, 🐙, 👾, 👹, 🐢, 👾, 😱, 🤖, 🐲, 🐙, 😱, 👹, 🐼, 🐲]
matched = []
picks = []
choose(positionOfCard) function:
If the number of picks is 2:
Do nothing (stop the player from choosing 3 cards).
Add positionOfCard to picks.
If the number of picks is now 2:
check()