Skip to content

Instantly share code, notes, and snippets.

View spekkionu's full-sized avatar

Jonathan Bernardi spekkionu

View GitHub Profile

This gist was made for Laravel 5.7, although it should work for any version. It also assumes you have a Laravel site set up and configured on a basic level (you ran composer install, npm install, created an app key, etc).

  1. Run npm install stimulus

  2. Run npm install babel-plugin-transform-class-properties --save-dev

  3. Create .babelrc file in your project root, and paste in the following content:

{
@webmandesign
webmandesign / gutenberg-wide-alignement-wrapper.php
Last active September 9, 2020 17:14
Wrapping aligned Gutenberg blocks with additional div on a WordPress website front-end.
<?php
// IMPORTANT UPDATE 20190307:
// Since WordPress 5.0.0 we can actually use much simpler solution:
/**
* Applies wrapper div around aligned blocks.
*
* Copy this function into your WordPress theme's `functions.php` file
* and change the `themeprefix` accordingly.
@grenzi
grenzi / Set-PsEnv.psm1
Last active February 21, 2023 23:11
sets powershell environment variables from python-dotenv formatted .env file
<#
.Synopsis
Exports environment variable from the .env file to the current process.
.Description
This function looks for .env file in the current directoty, if present
it loads the environment variable mentioned in the file to the current process.
based on https://github.com/rajivharris/Set-PsEnv
@EmadAdly
EmadAdly / Add-ESLint-to-Laravel-Mix.md
Last active January 20, 2024 16:55
Adding eslint to your Laravel application

1. Add eslint and eslint-loader and eslint-plugin-vue to your projects package.json file

npm i eslint eslint-loader eslint-plugin-vue --save-dev

2. Create a base configuration by --init

@mohanraj-r
mohanraj-r / scp-speed-test.sh
Last active March 5, 2024 10:31
[speed test] Test ssh connection speed
#!/bin/bash
# scp-speed-test.sh
# Author: Alec Jacobson alecjacobsonATgmailDOTcom
# http://www.alecjacobson.com/weblog/?p=635
#
# Test ssh connection speed by uploading and then downloading a 10000kB test
# file (optionally user-specified size)
#
# Usage:
# ./scp-speed-test.sh user@hostname [test file size in kBs]
// transform cropper dataURI output to a Blob which Dropzone accepts
function dataURItoBlob(dataURI) {
var byteString = atob(dataURI.split(',')[1]);
var ab = new ArrayBuffer(byteString.length);
var ia = new Uint8Array(ab);
for (var i = 0; i < byteString.length; i++) {
ia[i] = byteString.charCodeAt(i);
}
return new Blob([ab], { type: 'image/jpeg' });
}
@dwilkie
dwilkie / ubuntu_unattended_upgrades_gmail.markdown
Created July 2, 2015 10:28
Setup unattended upgrades on Ubuntu with Gmail

Install the unattended-upgrades package

$ sudo apt-get install unattended-upgrades 

Edit the periodic configuration

$ sudo nano /etc/apt/apt.conf.d/10periodic
@metaphorical
metaphorical / Mint-shortcut-VSCode.md
Last active March 16, 2023 12:17
Add shortcut to Application menu in Linux Mint

#Add shortcut to Application menu in Linux Mint

Example will be setting up VS Code on Mint and add shortcut to menu and panel.

Actually, it is really easy, you can just download ir from website, unzip in desired folder and run from there, so this is just about a way to add shourtcut where you want it.

##Download

https://code.visualstudio.com/Download

@JeffreyWay
JeffreyWay / .vimrc
Last active January 22, 2024 11:42
My .vimrc file
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15