Skip to content

Instantly share code, notes, and snippets.

View guymorita's full-sized avatar

Guy Morita guymorita

  • Square
  • New York City
View GitHub Profile
@guymorita
guymorita / tictactoe.sol
Created September 14, 2018 04:36
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=false&gist=
pragma solidity ^0.4.24;
import "github.com/OpenZeppelin/zeppelin-solidity/contracts/ownership/Ownable.sol";
contract TicTacToe is Ownable {
uint gameCount = 0;
mapping(uint => Game) games;
mapping(address => Game) latestGame;
@guymorita
guymorita / ballot.sol
Created September 12, 2018 14:48
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=true&gist=
pragma solidity ^0.4.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
@guymorita
guymorita / gist:6517869
Created September 11, 2013 00:36
three page path. final answer was P12:P9:P6 with 7 occurrences.
var fs = require('fs');
var _ = require('underscore');
var line, user, page;
var userPath = {};
fs.readFile('./input2.txt', 'utf8', function(err, data){
if (err) throw err;
var array = data.toString().split("\n");
for (i in array){
@guymorita
guymorita / gist:6176771
Created August 7, 2013 18:08
redis code
db.js
var redis = require("redis");
var config;
module.exports = function() {
client = redis.createClient(6379,'127.0.0.1');
client.flushdb();
// client = redis.createClient(6379,'nodejitsudb6625264643.redis.irstack.com');
// client.auth("nodejitsudb6625264643.redis.irstack.com:f327cfe980c971946e80b8e975fbebb4");
<div class="row">
<div class="span12 offset1">
<h1>Monumentos</h1>
<div class="row">
<div class="span9">{{> worldMap }}</div>
<div class="span2">
{{> currentUser}}
<h4>Leaderboard</h4>
{{> currentPlayers}}
</div>
@guymorita
guymorita / gist:6083192
Created July 25, 2013 19:58
monumento.js
Players = new Meteor.Collection("owut");
// HTMLttpsreport.deny({
// update: function(userId, docs, fields, modifier){
// return _.contains(fields, 'score');
// }
// })
// HTMLttpsreport.remove({});
CurrentGame = new Meteor.Collection("currentgame");
CurrentPoints = new Meteor.Collection("points");
HTMLttpsreport = new Meteor.Collection("players");
@guymorita
guymorita / gist:6083188
Created July 25, 2013 19:58
monument html
<head>
<title>monumentos</title>
<style>#map { width: 880px; height: 600px; }</style>
</head>
<body>
<div class="row">
<div class="span12 offset1">
<h1>Monumentos</h1>
<div class="row">
@guymorita
guymorita / gist:5726564
Last active December 18, 2015 04:39
ChatBuilder(working)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://chatbuilder.hackreactor.com/ChatBuilder.js"></script>
</head>
<body>
<script>
/*