Skip to content

Instantly share code, notes, and snippets.

View Tydewest's full-sized avatar
👨‍💻
Building The Future

Lachy Schuamcher Tydewest

👨‍💻
Building The Future
View GitHub Profile
@frankrausch
frankrausch / gist:572a3368c50b77be854265a8c91a77b2
Created May 13, 2020 21:26
Convert UIKeyCommand from deprecated init syntax to iOS 13 SDK syntax
# Regex:
UIKeyCommand\(input: (.+)\, modifierFlags: (.+), action: #selector\((.+)\), discoverabilityTitle: (.+)\),
# Replace:
UIKeyCommand(title: $4,
image: nil,
action: #selector($3),
input: $1,
modifierFlags: $2,
propertyList: nil,
@rogeriotaques
rogeriotaques / base64topdf-working.php
Last active October 22, 2024 12:33
Converts base64 string back to a pdf file
<?php
public function uploadFileFromBlobString($base64string = '', $file_name = '', $folder = '')
{
$file_path = "";
$result = 0;
// Convert blob (base64 string) back to PDF
if (!empty($base64string)) {
@Parassharmaa
Parassharmaa / export_mongodb.py
Last active January 21, 2023 16:34
Python script to export MongoDB collections to JSON file
import os
host = ""
username = ""
password = ""
directory_to_export = ""
database = ""
all_collections = []
@Nirma
Nirma / FTPUpload.swift
Last active December 30, 2023 02:11
Upload a file via FTP on iOS or macOS
import Foundation
import CFNetwork
public class FTPUpload {
fileprivate let ftpBaseUrl: String
fileprivate let directoryPath: String
fileprivate let username: String
fileprivate let password: String
@ericelliott
ericelliott / env-examples.md
Last active September 6, 2024 18:12
env-examples

Most configuration really isn't about the app -- it's about where the app runs, what keys it needs to communicate with third party API's, the db password and username, etc... They're just deployment details -- and there are lots of tools to help manage environment variables -- not the least handy being a simple .env file with all your settings. Simply source the appropriate env before you launch the app in the given env (you could make it part of a launch script, for instance).

env files look like this:

SOMEVAR="somevalue"
ANOTHERVAR="anothervalue"

To source it:

$ source dev.env # or staging.env, or production.env, depending on where you're deploying to