Skip to content

Instantly share code, notes, and snippets.

View MacgyverMartins's full-sized avatar

Macgyver MacgyverMartins

View GitHub Profile
@MacgyverMartins
MacgyverMartins / index.html
Created January 5, 2017 14:18
Funcionamento básico do Google Maps Drawing tools
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hackaton</title>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="style.css">
0xCCA25c83f2f8927bB657Bf7999a2D71964cf909e
pragma solidity ^0.4.16;
contract MyToken {
/* This creates an array with all balances */
mapping (address => uint256) public balanceOf;
/* Initializes contract with initial supply tokens to the creator of the contract */
function MyToken(
uint256 initialSupply
) public {
<!-- Trigger/Open The Modal -->
<button id="myBtn">Open Modal</button>
<!-- The Modal -->
<div id="myModal" class="modal">
<!-- Modal content -->
<div class="modal-content">
<span class="close">&times;</span>
<p>Some text in the Modal..</p>
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
@MacgyverMartins
MacgyverMartins / PrimaryLayout.jsx
Last active August 9, 2018 15:40
PrimaryLayout example
import React from 'react'
import { Switch, Route, Redirect } from 'react-router-dom'
import Header from '../componets/Header'
import HomePage from '../pages/HomePage'
import UsersPage from '../pages/UsersPage'
import ProductsPage from '../pages/ProductsPage'
const PrimaryLayout = ({ match }) => (
<div className="primary-layout">
import React, { Component } from 'react';
import SomeComponent from '../components/SomeComponent';
class HomePage extends Component {
render() {
return (
<section className="home-page">
<div className="nice-classname">
<h1>Macgyver</h1>
import React, { Component } from 'react';
import MainFilterCont from '../containers/MainFilter.container';
import Header from '../components/Header';
class HomePage extends Component {
render() {
return (
<section className="home-page">
<div className="nice-classname">
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { rangeCustomersBy } from '../actions/filter.actions';
class MainFilterCont extends Component {
// code
}
const mapDispatchToProps = {
import someAPI from '../services/someAPI';
export const GET_CUSTOMER = 'GET_CUSTOMER';
export const getCustomer = customerId => ({
type: GET_CUSTOMERS,
payload: someAPI.get(`customers/${customerId}`)
});