Skip to content

Instantly share code, notes, and snippets.

@solace
solace / makesrt.py
Last active September 21, 2021 04:34
Google Cloud Speech-to-Text SRT Generator
"""
Check out STEAM Powered (https://steampoweredshow.com/) where I have conversations
with women in STEAM to learn a bit about what they do and who they are.
https://steampoweredshow.com/learn-more/
"""
"""
Requirements
************
@solace
solace / README.md
Last active July 27, 2023 12:40
Django: augmented user_passes_test to accept params for test_func with matching template tag
@solace
solace / migration.py
Created November 6, 2020 14:00
Django: Add Permissions to Groups during Migration
# YMMV
from django.conf import settings
from django.contrib.auth.models import Group, Permission
from django.core.management.sql import emit_post_migrate_signal
from django.db import migrations, models
import django.db.models.deletion
import logging
@solace
solace / README.md
Created October 14, 2020 04:40
Custom SVG Definition for @fortawesome/react-fontawesome

Usage

Wherever you are initialising the FontAwesome library:

import { library } from '@fortawesome/fontawesome-svg-core';
import faTheName from 'custom-icon';

...
@solace
solace / rule.js
Last active May 7, 2022 15:48 — forked from vktr/rule.js
Auth0 Rule: Add Stripe Customer Id to existing token data
// If you have multiple rules in your workflow that need to update token data.
function (user, context, callback) {
user.app_metadata = user.app_metadata || {};
const token_namespace = 'https://your-domain.com/app_metadata';
// assumes your metadata object is shallow
const addCustomerId = stripe_customer_id => ({
...context.idToken[token_namespace],
@solace
solace / edl2timeline.py
Last active April 5, 2022 08:25
Convert DaVinci Resolve marker edl to YouTube usable timeline
"""
Check out STEAM Powered (https://steampoweredshow.com/) where I have conversations
with women in STEAM to learn a bit about what they do and who they are.
https://www.steampoweredshow.com/learn-more
"""
from pprint import pprint
from collections import OrderedDict
import sys
import re
@solace
solace / gist:0ea7c761ff448a0f3aa5c7a35a7de278
Created April 6, 2020 05:04
Import FileZilla Bookmarks to Cyberduck
# From https://trac.cyberduck.io/ticket/7317
#
# Should do it automatically, if it doesn't, check if ~/.config/filezilla/sitemanager.xml exists.
# If it doesn't, create the directory, and
cp ~/.filezilla/sitemanager.xml ~/.config/filezilla/sitemanager.xml
defaults delete ch.sudo.cyberduck bookmark.import.de.filezilla
# Relaunch Cyberduck
@solace
solace / fontawesome4to5.js
Last active March 6, 2020 02:04 — forked from timint/fontawesome4to5.js
Migrate Fontawesome 4 to 5 using jQuery (For the CSS Webfont version)
/*
* Migrate Fontawesome 4 to Fontawesome 5
* @website https://www.litecart.net/
*/
(function($){
var icons = {
"fa-500px": "fab fa-500px",
"fa-address-book-o": "far fa-address-book",
"fa-address-card-o": "far fa-address-card",
@solace
solace / WordPress to Buffer (Single Channel)
Last active March 4, 2019 04:22
Wordpress to Social Media via IFTTT - Messages with Hashtags
type Dict = { [key: string]: number };
const hashtags: Dict = {};
Wordpress.anyNewPostWp.TagsAndCategories.split(',').map(
s => hashtags['#' + s.toLowerCase().replace(/[\s-]+/g, '')] = 1
);
Buffer.addToBuffer.setMessage(
Wordpress.anyNewPostWp.PostTitle + "\n" +
Object.keys(hashtags).join(' ') + "\n" +
@solace
solace / sphp-changes
Created June 14, 2018 12:04
Update sphp to support PHP 5.5
# Update the support arrays to include 5.5.
brew_array=("5.5","5.6","7.0","7.1","7.2")
php_array=("[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]")
valet_support_php_version_array=("[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]")
# Search for the `brew link --force "$php_version"` line, and replace it with this.
if [[ $(echo "$php_version" | sed 's/^php@//' | sed 's/\.//') -lt 56 ]]
then
brew link --force --overwrite "$php_version"
else