Skip to content

Instantly share code, notes, and snippets.

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

Edmund vssn

🏠
Working from home
View GitHub Profile
@vssn
vssn / Cors.php
Created March 16, 2018 17:11 — forked from drewjoh/Cors.php
Laravel CORS Middleware
<?php // /app/Http/Middleware/Cors.php
namespace App\Http\Middleware;
use Closure;
class Cors {
public function handle($request, Closure $next)
{
return $next($request)
@vssn
vssn / bind.js
Created April 25, 2018 07:19 — forked from WickyNilliams/bind.js
Super simple one-way data-binding
/**
* follows a path on the given data to retrieve a value
*
* @example
* var data = { foo : { bar : "abc" } };
* followPath(data, "foo.bar"); // "abc"
*
* @param {Object} data the object to get a value from
* @param {String} path a path to a value on the data object
* @return the value of following the path on the data object
@vssn
vssn / yo.js
Created December 17, 2018 14:38
Combine template strings with custom functions
function endSentenceWithYo(template, ...expressions) {
return template.reduce((accumulator, part, i) => {
return accumulator + expressions[i - 1] + part
}) + ", yo!"
}
let type = 'delivery guy';
let name = 'Barry';
let says = 'Here ye go';
@vssn
vssn / settings.json
Created May 23, 2020 23:38
VS Code Color and Telemetry defaults
// VS Code Settings
{
"workbench.colorTheme": "White Italic Night",
"window.autoDetectColorScheme": true,
"workbench.preferredDarkColorTheme": "White Italic Night",
"workbench.preferredLightColorTheme": "White Italic",
"workbench.preferredHighContrastColorTheme": "White Italic",
"telemetry.enableCrashReporter": false,
"telemetry.enableTelemetry": false,
@vssn
vssn / remove_old_kernels.md
Created August 30, 2020 18:44 — forked from harshalbhakta/remove_old_kernels.md
Ubuntu Software Updater: Not enough free disk space

The upgrade needs a total of 81.5 M free space on disk '/boot'. Please free at least an additional 17.4 M of disk space on '/boot'. Empty your trash and remove temporary packages of former installations using 'sudo apt-get clean'.

http://askubuntu.com/questions/142926/cant-upgrade-due-to-low-disk-space-on-boot

Run below command as suggested in the error message.

$ sudo apt-get clean

First check your current kernel version.

#!/usr/bin/bash
cd laradock
docker-compose stop
docker-compose up -d nginx mariadb
MARIADB_IP=`docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' laradock_mariadb_1`
cd ..
sed -i "s/DB_HOST=.*/DB_HOST=$MARIADB_IP/" .env