This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<!-- Start of Google 1 --> | |
<script> | |
(function (w, d, s, l, i) { | |
w[l] = w[l] || []; | |
w[l].push({ "gtm.start": new Date().getTime(), event: "gtm.js" }); | |
var f = d.getElementsByTagName(s)[0], | |
j = d.createElement(s), | |
dl = l != "dataLayer" ? "&l=" + l : ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": 1, | |
"variables": [ | |
{ | |
"names": [ | |
"shopify_request_payload_hmac_sha256", | |
"shopify_draft_order_id", | |
"shopify_order_id" | |
], | |
"values": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
├── README.md | |
├── app.json | |
├── package.json | |
├── public | |
│ ├── favicon.ico | |
│ ├── index.html | |
│ └── manifest.json | |
├── src | |
│ ├── Config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// var products = [{ sku: 1 }, { sku: 2 }]; // Sample data (SKU of products from Magento Database) | |
var productsSku = products | |
.map(product => (product.sku || '').toString()) | |
.map(sku => sku.split(' ').filter(node => node.match(/^\S+$/))) | |
.reduce((acc, target) => Array.prototype.concat.apply(acc, target)) | |
.filter((value, index, self) => self.indexOf(value) === index) | |
.map(sku => `'${sku}'`) | |
.sort((x, y) => x - y) | |
.join(', '); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log(JSON.stringify(Object.values(Array.from(document.querySelectorAll('table:nth-child(2) tbody tr')).filter((x, i) => i > 2).map(x => ({ code: x.querySelector('td:nth-child(1)').innerText.trim(), name: x.querySelector('td:nth-child(2)').innerText.trim() })).filter(x => x.code.length).reduce((acc, x) => { acc[x.code] = x; return acc }, {})), null, 2)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Custom functions | |
function light() { | |
if [ -z "$2" ] | |
then src="pbpaste" | |
else | |
src="cat $2" | |
fi | |
$src | highlight -O rtf --syntax $1 --style solarized-light --font-size 18 | pbcopy | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import React, { Component } from 'react'; | |
import { | |
connectStyle, | |
Container, | |
Content, | |
ListItem, | |
Text, | |
Radio, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var wrongContent = 'nadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaaquinadaanadanadaaaannaannaanndnna'; | |
var filesToTest = Array.from(document.querySelectorAll('td a')).filter(x => x.href.match(/\.php$/)); | |
const testContent = (file) => { | |
return (response) => { | |
response.text() | |
.then(text => { | |
if (text.trim() != wrongContent) { | |
console.log(`O arquivo '${file.href}' tem o content: '${text}'`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
error() { echo "$@" 1>&2; } | |
file=$1 | |
if [ -z $file ]; then | |
error "Usage \`./migrate credentials.txt\`" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
var data = []; | |
var file = fs.readFileSync(process.argv[2], {encoding: 'utf-8'}); | |
file | |
.split('\n') | |
.forEach(x => { | |
if (data.indexOf(x) === -1) { | |
data.push(x); |
NewerOlder