Skip to content

Instantly share code, notes, and snippets.

View iurimatias's full-sized avatar

Iuri Matias iurimatias

View GitHub Profile
module MyExtension
def [](index)
#this works in iOS but in OSX self is treted as a Fixnum
self.indexAtPosition(index)
end
end
class NSIndexPath
include MyExtension
end
@iurimatias
iurimatias / sloli
Last active August 29, 2015 14:05 — forked from stephantual/sloli
#!/bin/bash
# v.1.0.8 (for PoC5 RC15+)
# SLOLI
# Super Lazy One Line Install (tm), or SLOLI, is for OSX Mavericks ONLY
# If you spot inefficiencies they are there for a reason (edge cases, supporting previously aborted installs, etc)
# INSTALL
# This script will install the GoLang implementation of ethereum, including:
# - brew
contract CollectFunds {
address owner;
uint startTime;
uint minimalValue;
function CollectFunds(uint minimum) {
owner = msg.sender;
startTime = now;
minimalValue = minimum;
}
@iurimatias
iurimatias / namecoin.sol
Created June 8, 2016 16:33
Simple Namecoin contract
contract Namecoin {
uint registrationCost;
mapping (string => string) public domains;
function Namecoin(uint _cost) {
registrationCost = _cost;
}
function register(string _domainName, string _ip) {
if (msg.value < registrationCost) throw;
pragma solidity ^0.4.8;
contract Token {
event Transfer(address indexed from, address indexed to, uint value);
event Approval( address indexed owner, address indexed spender, uint value);
mapping( address => uint ) _balances;
mapping( address => mapping( address => uint ) ) _approvals;
uint public _supply;
function Token( uint initial_balance ) {
{
"contracts": ["app/contracts/**"],
"app": {
"css/app.css": ["app/css/**"],
"js/app.js": ["embark.js", "app/js/**"],
"index.php": "app/index.php"
},
"buildDir": "dist/",
"config": "config/",
"plugins": {}
@iurimatias
iurimatias / contracts.js
Last active June 20, 2018 15:10
config/contracts.js
// config/contracts.js
module.exports = {
"testnet": {
"deployment": {
"accounts": [
{
"privateKey": "your_private_key"
},
{
"privateKeyFile": "path/to/file" // You can put more than one key, separated by , or ;
@iurimatias
iurimatias / simple_storage_test.js
Created June 20, 2018 15:03
simple_storage_test.js
const SimpleStorage = embark.require('Embark/contracts/SimpleStorage');
let accounts;
config({
// note: accounts is optional
accounts: [
{ mnemonic: "a 12 word mnemonic", "balance": "5 ether"}
]
contracts: {
"SimpleStorage": {
@iurimatias
iurimatias / contracts.js
Last active June 20, 2018 15:11
config/contracts.js
// config/contracts.js
module.exports = {
"development": {
"deployment": {
"accounts": [
{
"mnemonic": "12 word mnemonic",
"balance": "5 ether"
}
]
@iurimatias
iurimatias / imports_example.js
Created June 20, 2018 15:04
imports_example.js
import * as Contracts from 'embark/contracts'
import { SimpleStorage } from "embark/contracts"
import SimpleStorage from 'embark/contracts/SimpleStorage'