Skip to content

Instantly share code, notes, and snippets.

@Sroose
Sroose / AfterPluginInstall_BRANCHSDK.js
Created May 26, 2020 11:01
Hook to solve Branch.h file not found when using branch.io in Ionic/cordova
#!/usr/bin/env node
'use strict';
// THIS HOOK WILL ADD THE NEEDED HEADER SEARCH PATHS FOR THE BRANCH SDK (avoids error: 'Branch.h' file not found)
// Reference in config.xml in platform IOS: <hook type="after_plugin_install" src="hooks/AfterPluginInstall_BRANCHSDK.js" />
let cwd = process.cwd();
let fs = require('fs');
let path = require('path');
@Sroose
Sroose / no-arrow.directive.ts
Last active July 12, 2022 09:01
Ionic Angular directive to remove the arrow from an ion-select (and make placeholder look same as other elements)
/**
* Author: Sam Roose
*/
import { Directive, ElementRef } from '@angular/core';
@Directive({
selector: '[appNoArrow]'
})
export class NoArrowDirective {
@Sroose
Sroose / Iban.php
Created November 24, 2019 14:36
IBAN validation in PHP - example use for new Respect rule
<?php
/**
* Based on https://stackoverflow.com/a/20983340 and improved
*/
namespace OpenAPIServer\ValidationRules;
use Respect\Validation\Rules\AbstractRule;
@Sroose
Sroose / cleanPleskStuff.sh
Created August 31, 2019 12:26
Plesk cleanup script
#!/bin/bash
echo "CLEANING TEMPORARY PLESK UPDATE FILES"
echo "-------------------------------------"
echo
diskfree=`df / | awk '{ print $5 }' | tail -n 1`
echo "Current diskusage: " $diskfree
echo
echo "checking if plesk updater is not running.."
running=`ps aux | grep autoinstaller | grep -v "grep" | wc -l`
if [[ $running -gt 0 ]];then