Skip to content

Instantly share code, notes, and snippets.

View MacgyverMartins's full-sized avatar

Macgyver MacgyverMartins

View GitHub Profile
@MacgyverMartins
MacgyverMartins / site.js
Created June 28, 2019 15:30
Select de estado cidade para wix
// For full API documentation, including code examples, visit http://wix.to/94BuAAs
import { getJSON } from 'wix-fetch';
$w.onReady(function () {
getJSON('https://api.myjson.com/bins/1f4ht7').then(json => {
const estadosList = json.data.map(i => {
return { label: i.nome, value: i.nome }
});
$w('#dropdown1').options = estadosList
@MacgyverMartins
MacgyverMartins / bootstrap-4-sass-mixins-cheat-sheet.scss
Created August 14, 2018 15:27 — forked from anschaef/bootstrap-4-sass-mixins-cheat-sheet.scss
Bootstrap 4 Sass Mixins [Cheat sheet with examples]
/* -------------------------------------------------------------------------- */
// All Bootstrap 4 Sass Mixins [Cheat sheet]
// Updated to Bootstrap v4.1.x
// @author https://anschaef.de
// @see https://github.com/twbs/bootstrap/tree/v4-dev/scss/mixins
/* -------------------------------------------------------------------------- */
// Grid variables
$grid-columns: 12 !default;
$grid-gutter-width: 30px !default;
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}`)
});
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 SomeComponent from '../components/SomeComponent';
class HomePage extends Component {
render() {
return (
<section className="home-page">
<div className="nice-classname">
<h1>Macgyver</h1>
@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">
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, " "));
}
<!-- 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>
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 {