Skip to content

Instantly share code, notes, and snippets.

View fridzema's full-sized avatar

Robert Fridzema fridzema

View GitHub Profile
@if(!is_null(session('flash_notification')))
@foreach ((array)session('flash_notification') as $message)
@php $message = (array)$message[0]; @endphp
@javascript([
'Message' => $message
])
<script>
@fridzema
fridzema / ngrok-copy
Created December 15, 2017 20:21 — forked from mlsteele/ngrok-copy
Copy the url of the active ngrok connection to the clipboard.
#!/usr/bin/env bash
# Copy the url of the active ngrok connection to the clipboard.
# Usage:
# ngrok-copy # copies e.g. https://3cd67858.ngrok.io to clipboard.
# ngrok-copy -u # copies e.g. http://3cd67858.ngrok.io to clipboard.
if [[ "$1" == "-u" ]]; then
NGROK_URL=`curl -s http://127.0.0.1:4040/status | grep -P "http://.*?ngrok.io" -oh`
else
NGROK_URL=`curl -s http://127.0.0.1:4040/status | grep -P "https://.*?ngrok.io" -oh`
<script src="{{ asset('js/app.js') }}?v={{ filemtime(public_path('js/app.js')) }}"></script>
@fridzema
fridzema / forge.sh
Created February 5, 2018 14:23
Laravel Forge Setup Script
#
# REQUIRES:
# - server (the forge server instance)
# - event (the forge event instance)
# - sudo_password (random password for sudo)
# - db_password (random password for database user)
# - callback (the callback URL)
#
try
set theDestinationFolder to ((path to documents folder) as text) & "database_dumps" as alias
on error -- the folder doesn't exist
return beep 3
end try
public function handle()
{
$timings = [];
$results = [];
$loops = 10;
$bar = $this->output->createProgressBar($loops);
for($i = 1; $i <= $loops; $i++){
$start = microtime(true);
axios({
url: 'http://localhost/download.pdf',
method: 'GET',
responseType: 'blob',
}).then((response) => {
window.location = window.URL.createObjectURL(new Blob([response.data]));
});
@fridzema
fridzema / google-dorks
Created September 5, 2019 10:16 — forked from stevenswafford/google-dorks
Listing of a number of useful Google dorks.
" _ _ "
" _ /|| . . ||\ _ "
" ( } \||D ' ' ' C||/ { % "
" | /\__,=_[_] ' . . ' [_]_=,__/\ |"
" |_\_ |----| |----| _/_|"
" | |/ | | | | \| |"
" | /_ | | | | _\ |"
It is all fun and games until someone gets hacked!
@fridzema
fridzema / deployment-dev.sh
Last active September 11, 2019 09:11
Laravel development server deployment script on forge
#!/bin/bash
COMMITMSG=`git log -1 --pretty=%B`
PARALLEL_TASKS=('cache:clear' 'config:cache' 'route:cache' 'view:cache' 'event:cache' 'opcache:compile')
composer install --no-ansi --no-interaction --no-progress --no-dev --prefer-dist --optimize-autoloader --classmap-authoritative -q
php artisan deployment:start
if [[ $COMMITMSG =~ "SYNC" ]]
then
php artisan database:sync -C -M
export DEBIAN_FRONTEND=noninteractive
REMOVABLE_DEPS=('beanstalkd' 'memcached')
IMAGEMAGICK_DEPS=('imagemagick' 'pkg-config' 'libmagickwand-dev')
MEDIALIBRARY_DEPS=('jpegoptim' 'optipng' 'pngquant' 'gifsicle')
WKHTMLTOX_DEPS=('libfontenc1' 'xfonts-75dpi' 'xfonts-base' 'xfonts-encodings' 'xfonts-utils')
echo "\e[32mSetting system timezone"
sudo timedatectl set-timezone Europe/Amsterdam