Skip to content

Instantly share code, notes, and snippets.

pragma solidity ^0.4.0;
/*
Temporary Hash Registrar
========================
This is a simplified version of a hash registrar. It is purporsefully limited:
names cannot be six letters or shorter, new auctions will stop after 4 years.
pragma solidity ^0.4.18;
// File: contracts/ENS.sol
interface ENS {
// Logged when the owner of a node assigns a new owner to a subnode.
event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);
// Logged when the owner of a node transfers ownership to a new account.
@barrasso
barrasso / activity-indicator.swift
Created October 6, 2018 18:13 — forked from runys/activity-indicator.swift
Activity indicator in iOS 11 with Swift 4
// Create the Activity Indicator
let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .gray)
// Add it to the view where you want it to appear
view.addSubview(activityIndicator)
// Set up its size (the super view bounds usually)
activityIndicator.frame = view.bounds
// Start the loading animation
activityIndicator.startAnimating()
@barrasso
barrasso / main.go
Created August 29, 2018 19:05 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@barrasso
barrasso / how-to-use-web3-with-react-native.md
Created March 16, 2018 17:55
This file describes how to set up the Ethereum JS API web3.js with the boilerplate Create React Native App

How to set up web3.js with CRNA

This is a simple guide to get you started with using the Ethereum Javascript API (web3.js) with the Create React Native App project. This is not an in-depth guide.

  1. Make sure you have Node version 6 or later installed, if not, get it on the Node website

    node --version

  2. Install Create React Native App

@barrasso
barrasso / keybase.md
Created February 9, 2018 15:05
keybase proof

Keybase proof

I hereby claim:

  • I am barrasso on github.
  • I am markbarrasso (https://keybase.io/markbarrasso) on keybase.
  • I have a public key ASAn1DBKKdptJWrKWhLVjcJx9dgiazhbuhlrdkkn1-WoNQo

To claim this, I am signing this object:

@barrasso
barrasso / Double+Extension.swift
Created January 28, 2018 07:44
Double Extension - Swift 4
import Foundation
extension Double {
/// Rounds the double to decimal places value
func rounded(toPlaces places:Int) -> Double {
let divisor = pow(10.0, Double(places))
return (self * divisor).rounded() / divisor
}
}
@barrasso
barrasso / DataStorage.sol
Created October 16, 2017 21:46
Manages ownership and storage of document fingerprint data
pragma solidity^0.4.13;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
@barrasso
barrasso / Double+Extension.swift
Created October 9, 2017 16:17
Extends double to truncate decimal to desired amount of places
import Foundation
extension Double {
func truncate(places : Int)-> Double {
return Double(floor(pow(10.0, Double(places)) * self)/pow(10.0, Double(places)))
}
}
@barrasso
barrasso / Spacer.swift
Created October 3, 2017 02:35
Spacer view for UITableView
/* add spacer view between cells */
let spacerView : UIView = UIView(frame: CGRect(x: 0, y: 270, width: self.view.frame.size.width, height: 5))
spacerView.layer.backgroundColor = CGColor(colorSpace: CGColorSpaceCreateDeviceRGB(), components: [1.0, 1.0, 1.0, 1.0])
spacerView.layer.masksToBounds = false
spacerView.layer.shadowOffset = CGSize(width: -1, height: 1)
spacerView.layer.shadowOpacity = 0.2
cell.contentView.addSubview(spacerView)
cell.contentView.sendSubview(toBack: spacerView)