Skip to content

Instantly share code, notes, and snippets.

View robbydooo's full-sized avatar

Rob N robbydooo

  • TripAdvisor Ltd
  • United Kingdom
View GitHub Profile
@giannisp
giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active March 1, 2024 14:39
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
@robbydooo
robbydooo / RunScheduler.php
Last active October 23, 2021 14:14
Heroku Laravel Scheduler
<?php
/**
This Scheduler will run once every minute unlike the Heroku scheduler which only runs every 10 mintues.
To use this scheduler with Laravel 5.4+ add this file to /app/Console/Commands/RunScheduler.php
Register this file in app/Console/Kernel.php
@bonsi
bonsi / laravel-dusk-docker.md
Last active January 21, 2022 05:34
Get Laravel Dusk running within (lara)dock

NOTES

Working solution for laradock

  • spin up the selenium image (selenium/standalone-chrome) as included with laradock
  • in .env.dusk.local set APP_URL=http://nginx to point to the docker nginx image
  • in tests\DuskTestCase.php replace the line 'http://localhost:9515', DesiredCapabilities::chrome() with 'http://selenium:4444/wd/hub', DesiredCapabilities::chrome()
  • run php artisan dusk
  • ...
  • PROFIT
@rap2hpoutre
rap2hpoutre / gup-to-webpack.md
Last active November 22, 2023 00:30
Laravel 5.4: migrate from gulp to webpack
  • Create a webpack.mix.js file in root directory:
const { mix } = require('laravel-mix');

mix.js('resources/assets/js/app.js', 'public/js')
  .sass('resources/assets/sass/app.scss', 'public/css');
  
/* Optional: uncomment for bootstrap fonts */
// mix.copy('node_modules/bootstrap-sass/assets/fonts/bootstrap/','public/fonts/bootstrap');
@ddeveloperr
ddeveloperr / git_push_force_upstream.md
Last active September 6, 2023 15:52
How to force “git push” to overwrite remote repo files WITH LOCAL files

You want to push your local files to remote files

git push -f <remote> <branch>
git push -f origin master

Local version has priority over the remote one!

more...

@robbydooo
robbydooo / gist:6da8dec616ccb02f4d4d
Last active August 15, 2017 18:20
Docker Datacenter Cloud Init including Flocker
#cloud-config
package_upgrade: true
runcmd:
- rpm --import "https://pgp.mit.edu/pks/lookup?op=get&search=0xee6d536cf7dc86e2d7d56f59a178ac6c6238f52e"
- yum install -y yum-utils
- yum-config-manager --add-repo https://packages.docker.com/1.10/yum/repo/main/centos/7
- yum install -y docker-engine
- yum list installed clusterhq-release || yum install -y https://clusterhq-archive.s3.amazonaws.com/centos/clusterhq-release$(rpm -E %dist).noarch.rpm
@alanwill
alanwill / s3-bucket-move
Created December 5, 2015 20:27
Move an S3 bucket to a different region
aws s3 sync s3://oldbucket s3://newbucket --source-region us-west-1 --region us-west-2
@u0d7i
u0d7i / disable_vim_auto_visual_on_mouse.txt
Last active February 27, 2024 14:08
Disable vim automatic visual mode on mouse select
Disable vim automatic visual mode on mouse select
issue: :set mouse-=a
add to ~/.vimrc: set mouse-=a
my ~/.vimrc for preserving global defaults and only changing one option:
source $VIMRUNTIME/defaults.vim
set mouse-=a
@honkskillet
honkskillet / byte-sizetuts.md
Last active June 18, 2022 14:18
A series of golang tutorials with youtube videos.
@el22or
el22or / mysql-export-import
Last active September 28, 2022 12:04
Remote MySQL database dump directly into local database
## SSH - Remote export > local import
ssh USER@HOST mysqldump -uREMOTEDATABASEUSER -pREMOTEDATABASEPASSWORD -hREMOTEHOST REMOTEDATABASENAME | mysql -uLOCALDATABASEUSER -pLOCALDATABASEPASSWORD LOCALDATABASENAME
## Export to CSV
mysql -uUSER -pPASS DATABASENAME -B -e "select * from \`korisnici\`;" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > filename.csv
## Export to CSV 2
mysql -uUSER -pPASS DATABASE -B -e "SELECT users.uid AS 'ID', users.name AS 'Username', users.mail AS 'Email', from_unixtime(users.created) AS 'Created', from_unixtime(users.login) AS 'Last login' FROM users WHERE users.status=1 AND users.login!=0 ORDER BY users.login DESC;" | sed "s/'/\'/;s/\t/\",\"/g;s/^/\"/;s/$/\"/;s/\n//g" > vehicle_categories.csv
## Export to SQL gzipped file with compression