Skip to content

Instantly share code, notes, and snippets.

@barchard
barchard / forge_ioncube_php.sh
Created May 18, 2018 00:37 — forked from mechawrench/forge_ioncube_php_71.sh
Laravel Forge IonCube 7.1 Installation Recipe
wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar zxvf ioncube_loaders_lin_x86-64.tar.gz
PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")
PHP_EXT_DIR=$(php-config --extension-dir)
PHP_CONFD="/etc/php/${PHP_VERSION}/fpm/conf.d"
cp "ioncube/ioncube_loader_lin_${PHP_VERSION}.so" $PHP_EXT_DIR
echo "zend_extension = ${PHP_EXT_DIR}/ioncube_loader_lin_${PHP_VERSION}.so" > "${PHP_CONFD}/00-ioncube.ini"
PHP_CONFD="/etc/php/${PHP_VERSION}/cli/conf.d"
PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")
PHP_EXT_DIR=$(php-config --extension-dir)
@barchard
barchard / backup.sh
Last active March 1, 2018 00:05 — forked from tleish/mysql_backup.sh
Bash Script to backup all MySQL databases
#!/bin/bash
#==============================================================================
#TITLE: backup.sh
#DESCRIPTION: script for automating the daily mysql backups on development computer
#AUTHOR: tleish
#DATE: 2013-12-20
#VERSION: 0.4
#USAGE: ./mysql_backup.sh
#CRON:
# example cron for daily db backup @ 9:15 am
@barchard
barchard / pagination.html.twig
Last active February 20, 2016 13:10 — forked from SimonSimCity/pagination.html.twig
Updated for Bootstrap v3. Fixing issue with Next/Previous not using arrows. Fixing issue where in (in previous Bootstrap comment) arrows were not disabled if "showAlways" was true.
{#
Source: http://dev.dbl-a.com/symfony-2-0/symfony2-and-twig-pagination/
Updated by: Simon Schick <simonsimcity@gmail.com>
Parameters:
* currentFilters (array) : associative array that contains the current route-arguments
* currentPage (int) : the current page you are in
* paginationPath (string) : the route name to use for links
* showAlwaysFirstAndLast (bool) : Always show first and last link (just disabled)
* lastPage (int) : represents the total number of existing pages
### Keybase proof
I hereby claim:
* I am barchard on github.
* I am barchard (https://keybase.io/barchard) on keybase.
* I have a public key whose fingerprint is 0A79 22A8 1E59 FAAE 9B3C 54C9 4F05 246A F14F E9F6
To claim this, I am signing this object:
// Usually, initialize an NSImage with a black and white Vector image (pdf)
- (NSImage *)cdsMaskedWithColor:(NSColor *)color
{
CGRect rect = CGRectMake(0, 0, self.size.width, self.size.height);
NSImage *result = [[NSImage alloc] initWithSize:self.size];
[result lockFocusFlipped:self.isFlipped];
NSGraphicsContext *context = [NSGraphicsContext currentContext];
CGContextRef c = (CGContextRef)[context graphicsPort];