This file contains hidden or 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
curl \ | |
-H "Content-Type: application/json" \ | |
-H "Authorization: <REPLACE_WITH_YOUR_API_KEY>" \ | |
-X POST -d '{"options":{"open_tracking":true,"click_tracking":true},"return_path":"bounces@<REPLACE_WITH_YOUR_SENDING_DOMAIN_HERE>","metadata":{"some_useful_metadata":"testing_sparkpost"},"substitution_data":{"signature":"<REPLACE_WITH_YOUR_FIRST_AND_LAST_NAME>"},"recipients":[{"address":{"email":"<REPLACE_WITH_YOUR_EMAIL_ADDRESS>","tags":["learning"],"substitution_data":{"customer_type":"Platinum","first_name":"<REPLACE_WITH_YOUR_FIRST_NAME>"}}}],"content":{"from":{"name":"Awesome Company","email":"testing@<REPLACE_WITH_YOUR_SENDING_DOMAIN>"},"subject":"My first SparkPost Transmission","reply_to":"Awesome Company ","text":"Hi {{address.first_name}}\r\nYou have just sent your first email through SparkPost!\r\nCongratulations,\r\n{{signature}}","html":"<strong>Hi {{address.first_name}},</strong><p>You have just sent your first email through SparkPost!</p><p>Congratulations!</p>{{signature}}"}}' \ | |
https://api.sparkpos |
This file contains hidden or 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
class Payment::PostProcessing::CreditCard | |
def initialize(transaction) | |
@transaction = transaction | |
end | |
def after_payment(order) | |
@order = order | |
register_amount_paid | |
@order.pay! | |
save_credit_card |
This file contains hidden or 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/bash | |
# Source: http://blog.nonuby.com/blog/2012/07/05/copying-env-vars-from-one-heroku-app-to-another/ | |
set -e | |
sourceApp="$1" | |
targetApp="$2" | |
while read key value; do |
This file contains hidden or 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
import React, { Component } from 'react' | |
import PropTypes from 'prop-types' | |
import { injectStripe } from 'react-stripe-elements' | |
class CheckoutForm extends Component { | |
constructor (props) { | |
super(props) | |
this.handleSubmit = this.handleSubmit.bind(this) | |
this.onChange = this.onChange.bind(this) |
This file contains hidden or 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
import React from 'react' | |
import { CheckoutFormPure } from '../../src/components/checkout/checkout-form' | |
import { mount, configure } from 'enzyme' | |
import Adapter from 'enzyme-adapter-react-15' | |
configure({ adapter: new Adapter() }) | |
describe('components', () => { | |
describe('checkout component', () => { | |
it('should start a new checkout form with empty state', () => { |
This file contains hidden or 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
<div className={ classes.chipContainer }> | |
<Chip | |
label=' daqui uma semana ' | |
className={ classes.chip } | |
onClick={ () => this.pickTaskDeadline(7) } | |
/> | |
<Chip | |
label=' daqui quinze dias ' | |
className={ classes.chip } | |
onClick={ () => this.pickTaskDeadline(15) } |
This file contains hidden or 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
import network | |
from machine import ADC | |
from machine import Timer | |
import urequests | |
import os | |
secret = os.environ['SECRET'] | |
def send_sensor_values(): | |
adc = ADC(0) |
This file contains hidden or 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 express = require('express') | |
const app = express() | |
const cors = require('cors') | |
const bodyParser = require('body-parser') | |
const Notify = require('./mail') | |
if (process.env.NODE_ENV !== 'production') { | |
require('dotenv').config() | |
app.use(cors()) | |
} |
This file contains hidden or 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
git archive --format zip --output /full/path/to/zipfile.zip master |
This file contains hidden or 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 { | |
github | |
} = require('./secrets') | |
const passport = require('passport') | |
const gitHubStrategy = require('passport-github2').Strategy | |
const LocalStrategy = require('passport-local').Strategy | |
const passportJWT = require('passport-jwt') | |
const ExtractJWT = passportJWT.ExtractJwt | |
const JWTStrategy = passportJWT.Strategy | |
const jwt = require('jsonwebtoken') |