Skip to content

Instantly share code, notes, and snippets.

View carltondickson's full-sized avatar
🏠
Working from home

Carlton carltondickson

🏠
Working from home
  • Carlton Dickson Development Ltd.
  • London
View GitHub Profile
@DawidMyslak
DawidMyslak / vue.md
Last active April 22, 2024 12:49
Vue.js and Vuex - best practices for managing your state

Vue.js and Vuex - best practices for managing your state

Modifying state object

Example

If you have to extend an existing object with additional property, always prefer Vue.set() over Object.assign() (or spread operator).

Example below explains implications for different implementations.

@slava-vishnyakov
slava-vishnyakov / _browser_ide_helper.php
Last active June 5, 2020 15:23
Laravel Dusk IDE helpers
<?php
namespace Laravel\Dusk {
class Browser
{
use Concerns\InteractsWithAuthentication,
Concerns\InteractsWithCookies,
Concerns\InteractsWithElements,
Concerns\InteractsWithJavascript,
@mgirouard
mgirouard / guzzle-exceptions.md
Created July 17, 2016 00:36
GuzzleHttp Exception Hierarchy
  • GuzzleException
    • SeekException
    • TransferException
      • RequestException ( RequestInterface ; ResponseInterface | null )
        • TooManyRedirectsException
        • ConnectException
        • BadResponseException
          • ServerException
  • ClientException
@carltondickson
carltondickson / gist:3d3c978faba5becf838b
Created December 30, 2015 09:52
Virtual box mount on boot
# Ubuntu 14
sudo nano /etc/rc.local
mount -t vboxsf share_name_in_virtual_box /var/www/project
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@Ocramius
Ocramius / README.md
Last active January 22, 2024 00:09
`__invoke` vs `function` vs `Closure`
@mrtns
mrtns / gist:78d15e3263b2f6a231fe
Last active October 11, 2023 21:20
Upgrade Chrome from Command Line on Ubuntu
# Install
# via http://askubuntu.com/questions/510056/how-to-install-google-chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
# Update
@mandiwise
mandiwise / Count lines in Git repo
Last active May 5, 2024 21:37
A command to calculate lines of code in all tracked files in a Git repo
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository
$ git ls-files | xargs wc -l
@goranprijic
goranprijic / BaseModel.php
Created December 17, 2014 10:12
Check if table is already joined in Laravel Query Builder
<?php
class BaseModel extends Eloquent {
public static function isJoined($query, $table)
{
$joins = $query->getQuery()->joins;
if($joins == null) {
return false;
}
@aczietlow
aczietlow / selenium-php-webdriver-cheatsheet.md
Last active March 6, 2024 22:48 — forked from huangzhichong/selenium-webdriver-cheatsheet.md
Cheat sheet for using php webdriver (facebook/webdriver).

Webdriver PHP API workthough

  • Open a browser

    # start an instance of firefox with selenium-webdriver
    
    $browser_type = 'firefox'
    $host = 'http://localhost:4444/wd/hub'
    

$capabilities = array(\WebDriverCapabilityType::BROWSER_NAME => $browser_type);