Skip to content

Instantly share code, notes, and snippets.

View darocha's full-sized avatar

Marcelo Darocha darocha

View GitHub Profile
@darocha
darocha / starbucks_us_locations.json
Created May 8, 2019 00:53 — forked from wf9a5m75/starbucks_us_locations.json
8902 locations of US Starbucks with addresses, latitude, and longitude
This file has been truncated, but you can view the full file.
[
{
"position": {
"lat": 61.21759217,
"lng": -149.8935557
},
"name": "Starbucks - AK - Anchorage 00001",
"address": "601 West Street_601 West 5th Avenue_Anchorage, Alaska 99501",
"phone": "907-277-2477"
},
@darocha
darocha / asyncAssertions.js
Created April 20, 2019 21:22
Selenium e2e testint
// ./node_modules/.bin/mocha --require co-mocha "./e2e/tests/*.js"
it('autocompletes the name field', function*() {
driver.findElement(By.css('.autocomplete')).sendKeys('John');
driver.wait(until.elementLocated(By.css('.suggestion')))
driver.findElement(By.css('.suggestion')).click();
expect(yield driver.findElement(By.css('.autocomplete')).getAttribute('value')).to.equal('John Doe');
expect(yield driver.isElementPresent(By.css('.suggestion')).to.be.false;
});
// To configure new ERC721 assets
async displayBlueprint() {
const cert = new Cert({
schema: schema88
})
const asset = {
description: 'A lighthouse watercolor picture',
image: 'https://upload.wikimedia.org/wikipedia/commons/a/a3/Taran_Lighthouse_Kalinigrad_Oblast_Tatiana_Yagunova_Watercolor_painting.jpg',
name: 'Lighthouse Watercolor'
}
@darocha
darocha / info.plist.xml
Created February 9, 2019 15:36 — forked from mobilequickie/info.plist.xml
Facebook Login metadata for Info.plist on iOS
<!-- START OF FACEBOOK PLIST ENTRIES HERE -->
<key>FacebookAppID</key>
<string>1234567891234567</string>
<key>FacebookDisplayName</key>
<string>Auth Demo</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-share-api</string>
<string>fbauth2</string>
import UIKit
import AWSMobileClient
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
initializeAWSMobileClient() // Initialize the AWSMobileClient
}
@darocha
darocha / Splitter.sol
Created August 5, 2018 01:59 — forked from critesjosh/Splitter.sol
A contract to split funds between addresses. Demostrates pushing vs pulling transfers
pragma solidity ^0.4.6;
contract Splitter {
mapping(address => uint) public balances;
function unsafeSplit(address address1, address address2)
public
payable
returns(bool success)
$(".new-goods-submit-button").on('click',function(){
console.log('submitting goood');
//get hash of the good
var file_unique_hash = $("#good_file_input").data('uniquehash');
var file_name = "canoe";
var file_description = "a wooden boat";
@darocha
darocha / coindesk.sh
Created January 16, 2018 20:46 — forked from teklordz/coindesk.sh
Bitcoin prices in real time from the coindesk website api (bash script)
#!/bin/bash
# Credit to David Walsh for the original script <https://davidwalsh.name/bitcoin>
# The improved version of David's script doesn't go back to prompt. It keeps refreshing the prices every 5 seconds.
# Prices are in USD, EUR & GBP (in real time)
# curl must be installed in terminal
clear
echo "Coindesk BTC: "
echo " USD EUR GBP "
while [ 1 ]
@darocha
darocha / gist:874ff79a96047401aad8f1bd384e1653
Created January 16, 2018 20:30 — forked from simondlr/gist:45f0c8024a88d8dc54f8
Standard Token Contract on Ethereum
//Most, basic default, standardised Token contract.
//Based on standardised APIs & slightly extended. https://github.com/ethereum/wiki/wiki/Standardized_Contract_APIs
//adds AddressApproval & AddressApprovalOnce events
//approve & approveOnce works on premise that approved always takes precedence.
//adds unapprove to basic coin interface.
contract Coin {
function sendCoin(uint _value, address _to) returns (bool _success) {}
function sendCoinFrom(address _from, uint _value, address _to) returns (bool _success) {}
function coinBalance() constant returns (uint _r) {}
@darocha
darocha / web-servers.md
Created August 26, 2017 23:32 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000