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
function notifyOnLowMempoolFees() | |
local log = hs.logger.new("mempoolFeesTimer", 5) | |
log.i("Tick") | |
local url = "https://mempool.space/api/v1/fees/recommended" | |
hs.http.asyncGet(url, {}, function(status, body) | |
if status ~= 200 then | |
log.wf("Unexpected result from Mempool. Status code: %s", status) | |
return nil |
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
var AWS = require("aws-sdk"); | |
var IM = require('imagemagick'); | |
var FS = require('fs'); | |
var compressedJpegFileQuality = 0.60; | |
var compressedPngFileQuality = 0.95; | |
exports.handler = (event, context, callback) => { | |
var s3 = new AWS.S3(); | |
var sourceBucket = "klindoo-profile-pictures"; | |
var destinationBucket = "klindoo-profile-pictures-compressed"; |
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
// createPaymentIntent | |
RCT_EXPORT_METHOD(createSetupIntent:(NSString*)intent whitCc:(NSString*)cc withMo:(NSString*)month withYe:(NSString*)year withCvc:(NSString*)cvc withEmail:(NSString*)email withName:(NSString*)name callback:(RCTResponseSenderBlock)callback ){ | |
// convert the month and year values to NSNumber | |
NSNumber *num1 = @([month intValue]); | |
NSNumber *num2 = @([year intValue]); | |
STPPaymentMethodCardParams *cardParams = [STPPaymentMethodCardParams new]; | |
cardParams.number = cc; | |
cardParams.expMonth = num1; | |
cardParams.expYear = num2; |
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
router.post('/createStripeCustomer', function (req, res) { | |
var stripe = require("stripe")(stripe_sk); | |
var payment_method = req.body.payment_method | |
var name = req.body.name // optional | |
var email = req.body.email // optional | |
// This creates a new Customer and attaches the PaymentMethod in one API call. | |
stripe.customers.create({ | |
payment_method: payment_method, | |
name: name, | |
email: email |
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
/* qrl.proto sha256 sum for each release of QRL Node */ | |
const QRLPROTO_SHA256 = [ | |
{ | |
version: '0+unknown python', | |
protoSha256: | |
'b24a5c41468610914da57ac92f3cc2f74d89575f2626d5968f84ca211f55410c', | |
objectSha256: | |
'05db1f5956304387e1fec8b3a485ad89505d7d4b8ee4fd1ace186844302e93cf', | |
}, | |
] |
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 all the required packages | |
const express = require("express"); | |
const app = express(); | |
const cors = require("cors"); | |
const bodyParser = require("body-parser"); | |
const logger = require("morgan"); | |
// define port number | |
const port = process.env.PORT || 3001; | |
// instantiate express with the correct parameters |
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
#ifndef Stripe_h | |
#define Stripe_h | |
#import <Foundation/Foundation.h> | |
#import <React/RCTBridgeModule.h> | |
@interface StripeBridge : NSObject <RCTBridgeModule> | |
@end | |
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 <Foundation/Foundation.h> | |
#import "StripeBridge.h" | |
#import <Stripe/Stripe.h> | |
#import "CheckoutViewController.h" | |
@implementation StripeBridge | |
RCT_EXPORT_MODULE(); | |
// createPaymentIntent | |
RCT_EXPORT_METHOD(createPayment:(NSString*)clientSecret whitCc:(NSString*)cc withMo:(NSString*)month withYe:(NSString*)year withCvc:(NSString*)cvc callback:(RCTResponseSenderBlock)callback ){ |
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
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* | |
* @format | |
* @flow | |
*/ | |
import React from 'react'; | |
import { |
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 <Foundation/Foundation.h> | |
#import <Stripe/Stripe.h> | |
#import "CheckoutViewController.h" | |
#import "AppDelegate.h" | |
@interface CheckoutViewController () | |
@end | |
@implementation CheckoutViewController |
NewerOlder