Skip to content

Instantly share code, notes, and snippets.

View darocha's full-sized avatar

Marcelo Darocha darocha

View GitHub Profile
@darocha
darocha / blog-webpack-2.md
Created February 1, 2017 21:28 — forked from xjamundx/blog-webpack-2.md
From Require.js to Webpack - Part 2 (the how)

This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.

In that post I talked about 3 main reasons for moving from require.js to webpack:

  1. Common JS support
  2. NPM support
  3. a healthy loader/plugin ecosystem.

Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.

@darocha
darocha / ngrxintro.md
Created May 9, 2017 15:32 — forked from btroncone/ngrxintro.md
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@darocha
darocha / .gitlab-ci.yml
Created May 29, 2017 15:57 — forked from b0bbywan/.gitlab-ci.yml
Build and Deploy a javascript app with Gitlab-Ci
image: node:argon
before_script:
- apt-get -qq update
- apt-get -qq install -y python2.7 python2.7-dev build-essential make gcc g++ libicu-dev
- npm -g install npm --silent
- "echo -e \"export default {CLIENT_ID: '$CLIENT_ID'}\" > app/scripts/settings.js"
- npm set progress=false
- npm install --silent
@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
@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 / 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 ]
$(".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 / 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)
import UIKit
import AWSMobileClient
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
initializeAWSMobileClient() // Initialize the AWSMobileClient
}
@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>