Enjoy ! 😄
Download iTerm2 here.
// Cancel all the Stripe subscriptions supplied from a CSV export | |
const fs = require('fs') | |
const neatCsv = require('neat-csv') | |
const moment = require('moment') | |
const stripe = require('stripe')('sk_live_xxx') | |
// subscriptions.csv is the full export of subs from the stripe billing dashboard | |
fs.readFile('./subscriptions.csv', async (err, data) => { | |
if (err) return console.error(err) |
Enjoy ! 😄
Download iTerm2 here.
#!/usr/bin/env bash | |
# supervisor-log-compress.sh | |
# | |
# supervisord writes logs, and rotates them, but does not compress old log | |
# files. This script is meant to help with that cleanup, reclaiming storage. | |
# | |
# A nice place for this script is in: /etc/cron.daily/ | |
for f in /var/log/supervisor/*.log.*; do |
Laravel 10+, Horizon 5.x, Redis/Valkey 7+
Prepare application
http://yourapp.com/horizon
inactive
on horizon dashboardInstall redis-server
#!/bin/python | |
# | |
# Copyright 2016 Flavio Garcia | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
import requests | |
def get_status_code(url): | |
try: | |
r = requests.get(url) | |
print "Processing " + url | |
if len(r.history) > 0: | |
chain = "" | |
code = r.history[0].status_code |
""" | |
Author: Eric J. Ma | |
Purpose: To merge PDFs together in an automated fashion. | |
""" | |
import os | |
from PyPDF2 import PdfFileReader, PdfFileMerger |
"""Asynchronous requests in Flask with gevent""" | |
from time import time | |
from flask import Flask, Response | |
from gevent.pywsgi import WSGIServer | |
from gevent import monkey | |
import requests |