Skip to content

Instantly share code, notes, and snippets.

Working hard!

Jamie Shields jayshields

Working hard!
Block or report user

Report or block jayshields

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jayshields /
Last active Jul 26, 2018
MySQL 5.7.22 on Ubuntu 18.04 set root password to blank (for local dev only!)
sudo /etc/init.d/mysql stop
sudo mkdir /var/run/mysqld/
sudo chown mysql /var/run/mysqld/
sudo mysqld_safe --skip-grant-tables &
mysql -u root
use mysql;
update user set authentication_string = PASSWORD(""), plugin = "mysql_native_password" where User='root';
flush privileges;
sudo /etc/init.d/mysql stop
jayshields / ac_invoices_total_bookmarklet.js
Created Sep 28, 2016
Active Collab invoice total bookmarklet
View ac_invoices_total_bookmarklet.js
$('[ng-repeat="invoices in grouped_invoices"]').each(function(){
var total = 0;
total += parseInt($(this).text().replace(',','').replace('.00',''));
jayshields / whitelist_access_origin.php
Created Aug 11, 2016
Access-Control-Allow-Origin whitelist for Silex
View whitelist_access_origin.php
$app->after(function(Request $request, Response $response){
$access_whitelist = array('', '', '');
if(in_array($_SERVER['HTTP_ORIGIN'], $access_whitelist))
$response->headers->set('Access-Control-Allow-Origin', $_SERVER['HTTP_ORIGIN']);
jayshields / index.php
Created Nov 24, 2015
Dropbox API output images from directory
View index.php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, '');
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer MY_DROPBOX_ACCESS_KEY',
'Content-Type: application/json',
'Accept: application/json'
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
jayshields / script.js
Last active Nov 7, 2015
NatWest online banking print statement fix
View script.js
You can’t perform that action at this time.