Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Carlton carltondickson

🏠
Working from home
  • Carlton Dickson Development Ltd.
  • London
View GitHub Profile
@DawidMyslak
DawidMyslak / vue.md
Last active Dec 8, 2022
Vue.js and Vuex - best practices for managing your state
View vue.md

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.

View _browser_ide_helper.php
<?php
namespace Laravel\Dusk {
class Browser
{
use Concerns\InteractsWithAuthentication,
Concerns\InteractsWithCookies,
Concerns\InteractsWithElements,
Concerns\InteractsWithJavascript,
@mgirouard
mgirouard / guzzle-exceptions.md
Created Jul 17, 2016
GuzzleHttp Exception Hierarchy
View guzzle-exceptions.md
  • GuzzleException
    • SeekException
    • TransferException
      • RequestException ( RequestInterface ; ResponseInterface | null )
        • TooManyRedirectsException
        • ConnectException
        • BadResponseException
          • ServerException
  • ClientException
View gist:3d3c978faba5becf838b
# Ubuntu 14
sudo nano /etc/rc.local
mount -t vboxsf share_name_in_virtual_box /var/www/project
@spalladino
spalladino / mysql-docker.sh
Created Dec 22, 2015
Backup and restore a mysql database from a running Docker mysql container
View mysql-docker.sh
# 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 Jul 16, 2022
`__invoke` vs `function` vs `Closure`
View README.md
@mrtns
mrtns / gist:78d15e3263b2f6a231fe
Last active Jan 3, 2023
Upgrade Chrome from Command Line on Ubuntu
View gist:78d15e3263b2f6a231fe
# 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
@goranprijic
goranprijic / BaseModel.php
Created Dec 17, 2014
Check if table is already joined in Laravel Query Builder
View BaseModel.php
<?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 Nov 20, 2022 — forked from huangzhichong/selenium-webdriver-cheatsheet.md
Cheat sheet for using php webdriver (facebook/webdriver).
View selenium-php-webdriver-cheatsheet.md

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);

@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active Jan 22, 2023
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.
View gitflow-breakdown.md

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository