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
require 'json' | |
require 'stripe' | |
class ChargeApp < Sinatra::Base | |
AMOUNT = 300 | |
Stripe.api_key = "SECRET_STRIPE_API_KEY" | |
post '/charge' do | |
status = charge_customer(params[:stripeToken, params[:stripeEmail]) |
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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>CopyFixes.com - Quick fixes of your copywriting from professionals</title> | |
</head> | |
<body> | |
<section> | |
<h1>CopyFixes.com</h1> | |
<h2>Quick fixes of your copywriting by professionals</h2> |
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
function checkSpreadsheetIfPaid(email, has_paid, has_not_paid) { | |
var sheetsuURI = "https://sheetsu.com/apis/v1.0/c12aec61/search", | |
params = "?email=" + email; | |
$.ajax({ | |
url: sheetsuURI+params, dataType: 'json', type: 'GET', | |
success: has_paid, | |
error: has_not_paid | |
}); | |
} |
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
require 'pry' | |
require 'json' | |
require 'httparty' | |
require 'stripe' | |
class ChargeApp < Sinatra::Base | |
AMOUNT = 300 | |
Stripe.api_key = "SECRET_STRIPE_KEY" |
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> | |
<script src="https://code.jquery.com/jquery-3.0.0-alpha1.js"></script> | |
</head> | |
<body> | |
<ul id="characters-list"></ul> | |
<script> | |
var sheetsuUrl = "https://sheetsu.com/apis/v1.0/020b2c0f"; |
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
import requests | |
url = 'https://sheetsu.com/apis/YOUR_API_ID' | |
data = {"timestamp": "1458819671995", "idea": "wooho"} | |
r = requests.post(url, json=data) | |
print r.status_code | |
print r.json() |
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
module SheetCRUD | |
module Error | |
ERRORS = [ | |
unauthorized: { message: 'Unauthorized.', status: 401 }, | |
limit_exceed: { message: 'Rate limit exceed.', status: 429 }, | |
not_found: { message: 'Not found.', status: 404 } | |
] | |
class StandardAPIError < StandardError |
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
angular.module('app').service('Subjucator', [ | |
'$http', function($http) { | |
return { | |
get: function(url) { | |
return $http.get(url); | |
}, | |
post: function(url, data) { | |
return $http.post(url, data); | |
} | |
}; |
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> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> | |
</head> | |
<body> | |
<form id="form"> | |
<input type="text" name="name"> | |
<input type="text" name="score"> | |
<button type="submit">submit</button> |