Skip to content

Instantly share code, notes, and snippets.

Stripe.api_key = # your API key
nextCharges = Stripe::Charge.all(:limit => 100)
data = nextCharges.data
while nextCharges.has_more do
nextCharges = Stripe::Charge.all(:limit => 100, :starting_after => data[data.length - 1].id)
data = data + nextCharges.data
end
data.inject(0) {| sum, nextCharge | sum + nextCharge.amount }
@agentcoops
agentcoops / ViewController.swift
Created September 13, 2015 08:33
ViewController.swift
//
// ViewController.swift
// testingstripe
//
// Created by Charles Francis on 5/22/15.
// Copyright (c) 2015 Charles Francis. All rights reserved.
import UIKit
class ViewController: UIViewController, PKPaymentAuthorizationViewControllerDelegate {
@agentcoops
agentcoops / ios7.swift
Created September 24, 2015 22:19
IOS 7 Swift
func paymentAuthorizationViewController(
controller: PKPaymentAuthorizationViewController,
didAuthorizePayment payment: PKPayment,
completion: ((PKPaymentAuthorizationStatus) -> Void)) {
self.handlePaymentAuthorizationWithPayment(payment, completion:completion);
}
func handlePaymentAuthorizationWithPayment(payment: PKPayment, completion: ((PKPaymentAuthorizationStatus) -> Void)!) {
STPAPIClient.sharedClient().createTokenWithPayment(
@agentcoops
agentcoops / cuda_11.8_installation_on_Ubuntu_22.04
Last active January 31, 2025 18:55 — forked from MihailCosmin/cuda_11.8_installation_on_Ubuntu_22.04
Instructions for CUDA v11.8 and cuDNN 8.7 installation on (wsl) Ubuntu 22.04 for PyTorch 2.0.0
#!/bin/bash
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
### to verify your gpu is cuda enable check