Skip to content

Instantly share code, notes, and snippets.

View BramEsposito's full-sized avatar
🌊

Bram Esposito BramEsposito

🌊
View GitHub Profile
@BramEsposito
BramEsposito / MySQL_macOS_Sierra.md
Created January 16, 2017 20:26 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@BramEsposito
BramEsposito / install new mac.sh
Created January 9, 2017 10:12
install script for new mac
echo "Enter your username: (for git usage)"
read UserName
echo "Enter your email address: (for git usage)"
read EmailAddress
# Ask for the administrator password upfront
sudo -v
echo "Installing xcode-stuff"
xcode-select --install
@BramEsposito
BramEsposito / generatepasswd.pl
Last active October 17, 2016 14:27
Generate a Dutch password following the XKCD philosophy
# /usr/bin/perl
# documentation: http://bbusschots.github.io/hsxkpasswd/Crypt-HSXKPasswd/pod.html
# install: sudo cpan Crypt::HSXKPasswd
use Crypt::HSXKPasswd;
use Crypt::HSXKPasswd::Dictionary::NL;
my $hsxkpasswd_instance = Crypt::HSXKPasswd->new(
@BramEsposito
BramEsposito / backgroundimagesize.js
Created September 13, 2016 09:23
Run this script as a bookmarklet or in your console to detect if you have oversized background images on your page
(function() {
// the minimum version of jQuery we want
var v = "1.3.2";
// check prior inclusion and version
if (window.jQuery === undefined || window.jQuery.fn.jquery < v) {
var done = false;
var script = document.createElement("script");
script.src = "http://ajax.googleapis.com/ajax/libs/jquery/" + v + "/jquery.min.js";
<?php
for ($i=0;$i<20;$i++) {
print("032 ".ri().ri().ri()." ".ri().ri()." ".ri().ri()." ".ri().ri())."\n";
}
function ri() {
return rand(0,9);
}
?>
@BramEsposito
BramEsposito / optimize.php
Last active May 26, 2016 12:34
Optimize your images when uploaded with IMCE
<?php
/**
* You need to have module imageapi_optimize enabled
*/
function HOOK_file_presave($file) {
// only temporary files from IMCE
if ($file->source === 'imce' && $file->status == 0) {
if ($wrapper = file_stream_wrapper_get_instance_by_uri($file->uri)) {
@BramEsposito
BramEsposito / .gitignore
Created March 21, 2016 10:12 — forked from salcode/.gitignore
.gitignore file for WordPress - Bare Minimum Git
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@BramEsposito
BramEsposito / drush_phpinfo.sh
Created January 21, 2016 11:11
get php_info for the drush process
# get information over the php version (php_info)
drush php-eval "phpinfo();" | less
@BramEsposito
BramEsposito / enable-drush-debugging.sh
Last active February 16, 2018 08:42
How to enable Drush debugging on MAMP
# set the correct php.ini for drush!
export PHPRC='/Library/Application Support/appsolute/MAMP PRO/conf/'
export PHP_OPTIONS="-dxdebug.remote_autostart=On -didekey=PHPSTORM -dremote_host=localhost -dprofiler_enable=1"
# FROM https://www.deeson.co.uk/labs/debugging-drupal-drush-real-time-phpstorm-and-xdebug
@BramEsposito
BramEsposito / enable-drush-debugging.sh
Created January 21, 2016 08:29
How to enable Drush debugging
export PHP_OPTIONS="-dxdebug.remote_autostart=On -didekey=PHPSTORM -dremote_host=localhost -dprofiler_enable=1"