Skip to content

Instantly share code, notes, and snippets.

View smashkins's full-sized avatar
👨‍🎨
wwdc excited!

Vincenzo Stira smashkins

👨‍🎨
wwdc excited!
View GitHub Profile
//: A UIKit based Playground for presenting user interface
import UIKit
import PlaygroundSupport
class MyViewController : UIViewController {
override func loadView() {
let view = UIView()
view.backgroundColor = .gray
@smashkins
smashkins / Voting.sol
Last active March 22, 2018 13:04
Solidity Hello World Voting DApp
pragma solidity ^0.4.18;
// We have to specify what version of compiler this code will compile with
contract Voting {
/* mapping field below is equivalent to an associative array or hash.
The key of the mapping is candidate name stored as type bytes32 and value is
an unsigned integer to store the vote count
*/
mapping (bytes32 => uint8) public votesReceived;
@smashkins
smashkins / index.js
Created May 24, 2017 11:12
Javascript Hello World Voting DApp
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
abi = JSON.parse('[{"constant":false,"inputs":[{"name":"candidate","type":"bytes32"}],"name":"totalVotesFor","outputs":[{"name":"","type":"uint8"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"candidate","type":"bytes32"}],"name":"validCandidate","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"votesReceived","outputs":[{"name":"","type":"uint8"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"x","type":"bytes32"}],"name":"bytes32ToString","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"candidateList","outputs":[{"name":"","type":"bytes32"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"candidate","type":"bytes32"}],"name":"voteForCandidate","outputs":[],"payable":false,"type":"func
@smashkins
smashkins / index.html
Created May 24, 2017 11:10
Hello World Voting DApp
<!DOCTYPE html>
<html>
<head>
<title>Hello World DApp</title>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<link href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css' rel='stylesheet' type='text/css'>
</head>
<body class="container">
<h1>A Simple Hello World Voting Application</h1>
<div class="table-responsive">
@smashkins
smashkins / Glow.swift
Created January 17, 2017 10:04 — forked from mitchellporter/Glow.swift
Glow Effect for UILabel and UIButton
self.layer.shadowColor = UIColor.redColor().CGColor
self.layer.shadowRadius = 4.0
self.layer.shadowOpacity = 0.9
self.layer.shadowOffset = CGSizeZero
self.layer.masksToBounds = false