Skip to content

Instantly share code, notes, and snippets.

Macgyver MacgyverMartins

Block or report user

Report or block MacgyverMartins

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@MacgyverMartins
MacgyverMartins / site.js
Created Jun 28, 2019
Select de estado cidade para wix
View site.js
// 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
View bootstrap-4-sass-mixins-cheat-sheet.scss
/* -------------------------------------------------------------------------- */
// 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;
View MainFilter.continer.jsx
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { rangeCustomersBy } from '../actions/filter.actions';
class MainFilterCont extends Component {
// code
}
const mapDispatchToProps = {
View customers.actions.js
import someAPI from '../services/someAPI';
export const GET_CUSTOMER = 'GET_CUSTOMER';
export const getCustomer = customerId => ({
type: GET_CUSTOMERS,
payload: someAPI.get(`customers/${customerId}`)
});
View HomePage-v2.jsx
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">
View HomePage.jsx
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 Aug 9, 2018
PrimaryLayout example
View PrimaryLayout.jsx
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">
View changePrice
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, " "));
}
View index.html
<!-- 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>
View SimpleToken.sol
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 {
You can’t perform that action at this time.