Skip to content

Instantly share code, notes, and snippets.

View modpluz's full-sized avatar

Remi Adewale modpluz

View GitHub Profile
@modpluz
modpluz / gist:ac7a0c23e459099c7e675eed6dbcf01e
Created April 1, 2022 23:01 — forked from benshimmin/gist:4088493
Scale to fit and centre-align an image with FPDF
<?php
/* Caveat: I'm not a PHP programmer, so this may or may
* not be the most idiomatic code...
*
* FPDF is a free PHP library for creating PDFs:
* http://www.fpdf.org/
*/
require("fpdf.php");
class PDF extends FPDF {
@modpluz
modpluz / androidx.txt
Last active April 15, 2020 19:00
Disable AndroidX
android.useAndroidX=false
android.enableJetifier=false
@modpluz
modpluz / gist:072e1f2b4a1429dbcf2306c1b2fbbf47
Last active March 21, 2019 20:14
React Native Android build Troubleshooting
Rebuild Bundle
`react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res`
error: Duplicate file. Original is here. The version qualifier may be implied.
`rm -rf android/app/src/main/res/drawable-xxxhdpi android/app/src/main/res/drawable-xxhdpi android/app/src/main/res/drawable-xhdpi android/app/src/main/res/drawable-mdpi android/app/src/main/res/drawable-hdpi`
`cd android && ./gradlew assembleRelease`
@modpluz
modpluz / NPM install without sudo
Created December 1, 2018 15:41 — forked from gregpalaci/NPM install without sudo
NPM install without sudo
sudo chown -R `whoami` ~/.npm
sudo chown -R `whoami` /usr/local/lib/node_modules
@modpluz
modpluz / appFonts.txt
Created October 19, 2018 14:54
List all fonts available to app in iOS
for (NSString* family in [UIFont familyNames])
{
NSLog(@"%@", family);
for (NSString* name in [UIFont fontNamesForFamilyName: family])
{
NSLog(@" %@", name);
}
}
@modpluz
modpluz / copy_files.sh
Created July 6, 2017 18:28
Copy media files and create directory if necessary
#!/usr/bin/env bash
shopt -s globstar
numberRegex='^[0-9]+$'
for d in static/* static/**/* ; do
if [ -d ${d} ]; then
bn=$(basename $d)
# We only care about media resources
if [[ "$bn" = "images" || ("$bn" = "videos" || "$bn" = "sounds") ]]; then
for filepath in $(ls $d) ; do
#!/bin/bash
formail -R cc X-original-cc \
-R to X-original-to \
-R bcc X-original-bcc \
-f -A"To: new@email.com" \
| /usr/sbin/sendmail -t -i
# pipe all to a log instead, comment out formail code
#tee -a /tmp/trapmail.log > /dev/null