Skip to content

Instantly share code, notes, and snippets.

View alexanmtz's full-sized avatar
🎯
Focusing

Alexandre Magno alexanmtz

🎯
Focusing
View GitHub Profile

Integrating Stripe with Rails (Concise)

This written tutorial is a concise version of this tutorial, which covers building a payment system into a Rails app using Stripe.js. It assumes a basic familiarity with Ruby on Rails, Git and the command-line.

What's covered

  • Setting up a basic Rails app with a scaffold generator
  • Integrating Stripe charges
  • Deploying to Heroku
var OAuth = require('oauth')
// `npm install oauth` to satisfy
// website: https://github.com/ciaranj/node-oauth
var KEY = "<INSERT KEY HERE>"
var SECRET = "<INSERT SECRET HERE>"
var oauth = new OAuth.OAuth(
'http://api.thenounproject.com',
'http://api.thenounproject.com',
@roachhd
roachhd / README.md
Last active May 29, 2025 16:27
EMOJI cheatsheet 😛😳😗😓🙉😸🙈🙊😽💀💢💥✨💏👫👄👃👀👛👛🗼🔮🔮🎄🎅👻

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. ✈ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: 😄

@nazrdogan
nazrdogan / delayonehour.cc
Last active October 26, 2020 21:35
arduino 1 hour delay
#include <dht.h>
dht DHT;
#define DHT11_PIN 5
const long oneSecond = 1000; // a second is a thousand milliseconds
const long oneMinute = oneSecond * 60;
const long oneHour = oneMinute * 60;
const long oneDay = oneHour * 24;
@bdeanindy
bdeanindy / SparkPost cURL Create (POST) Transmissions API Example
Last active September 30, 2020 11:32
cURL POST Example to send an email using the SparkPost Transmissions API
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
@DanCoughlin
DanCoughlin / seeds.rb
Last active February 12, 2021 11:27
Example of a database seed file for rails
# loop over this 5 times
5.times do |i|
# create a topic with the name provided name and description
t = Topic.create(title: "Topic ##{i}", description: "This topic is cool because everyone loves the topic number ##{i}.")
# create a random number between 1 and 100 and loop that many times create a vote for this topic
rand(1..100).times do |j|
t.votes.create
end
end
# create a user with this email address and password
@Bakual
Bakual / crowdin.php
Last active October 28, 2019 19:37
Crowdin Update Source or Translation
<?php
/**
* Crowdin Upload Translation
* Usage:
* - Upload (latvian) translation: php crowdin.php --key=abcdefg --lang_joomla=lv-LV --lang_crowdin=lv
* The argument `--approved=1` will upload the source or translation as approved
* The argument `--branch=4.0-dev will upload the translations for Joomla 4.0. By default it will upload to staging.
*
* @package Joomla.Cli
*
@amitpatelx
amitpatelx / command.sh
Created September 23, 2015 10:47
fatal: Could not read from remote repository error while deploying using Capistrano
#Run following commands in sequence to fix the issue
$ eval "$(ssh-agent -s)"
$ ssh-add ~/.ssh/id_rsa
$ cap production deploy
@matthewarkin
matthewarkin / plaid+managed.md
Last active January 25, 2022 21:10
Plaid and Managed Accounts

Ensuring Valid External Accounts with Stripe and Plaid

When adding a bank account to a customer in Stripe, Stripe forces you to verify the bank account (either through microdeposits or through Plaid. This is useful because you don't want to withdraw money from a bank account that a user does not own. However when it comes to sending money to bank accounts, Stripe does not require you to verify the account. After all why would you send money to an account that you're not in control of. But lets face it, users make mistakes and its not uncommon for them to type their routing or account number which can significantly delay their transfers.

One way to prevent this is to get their routing and account number directly from their bank and avoid the possibility of user error. This is where Plaid comes in. Plaid provides instant ACH verification by having the user log into their bank account (similiar to what you may done if you've ever used Mint). The u

@psobocinski
psobocinski / dummy_controller.rb
Created January 23, 2016 20:04
Asserting on a JSON response in a Rails controller test with MiniTest
class DummyController < ApplicationController
def do
render json: { balance: 50 }
end
end