Skip to content

Instantly share code, notes, and snippets.

View verschuur's full-sized avatar
🤠

Govert Verschuur verschuur

🤠
  • Funxtion
  • Amsterdam
View GitHub Profile
@sators
sators / connect.php
Last active April 11, 2024 07:17
PHP MySQLi Amazon Aurora RDS EC2 IAM Role Based Authentication
<?php
/********* CONFIG ********/
$clusterEndpoint = "";
$clusterPort = 3306;
$clusterRegion = "us-east-1";
$dbUsername = "";
$dbDatabase = "";
/*************************/
@jhoff
jhoff / README.md
Last active April 1, 2024 07:45
Bash-only Laravel Artisan tab auto-complete

If you are an Oh-my-zsh user, see the Laravel 5 plugin

For the rest of us Bash users, all of the Laravel Artisan autocomplete solutions out there require installing a composer package to get a list of artisan commands. Turns out this isn't really necessary. Simply add the provided code in ~/.bash_profile ( or similarly sourced file ) and you'll get artisan command tab completes on any project on your system.

_artisan()
{
	COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
	COMMANDS=`php artisan --raw --no-ansi list | sed "s/[[:space:]].*//g"`
	COMPREPLY=(`compgen -W "$COMMANDS" -- "${COMP_WORDS[COMP_CWORD]}"`)
@poing
poing / laravel_facades.md
Last active March 25, 2024 21:37
Laravel Facades

Understanding Facades in Laravel

What's a Facade?

The Laravel explination, shown below is confusing.

Facades provide a "static" interface to classes that are available in the application's service container. Laravel ships with many facades which provide access to almost all of Laravel's features. Laravel facades serve as "static proxies" to underlying classes in the service container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods.

Many examples use Cache::get('key') to demonstrate how a Facade works. Comparing the following code to the utility that a Facade provides.

@mesgarpour
mesgarpour / appsScript_ListFilesFolders_ver.2.js
Last active March 10, 2024 00:55
[Google Apps Script] List all files & folders in a Google Drive folder, & write into a speadsheet
/*
* Copyright 2017 Mohsen Mesgarpour
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@addyosmani
addyosmani / package.json
Last active January 18, 2024 21:31
npm run-scripts boilerplate
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",
@ZachTRice
ZachTRice / ssh_keys_synology_dsm_6
Last active July 31, 2023 11:50
Install SSH Keys on Synology DSM 6
Full Instructions here: https://forum.synology.com/enu/viewtopic.php?t=126166
System: Synology DS1815+ running DSM 6
Log into Synology web UI as an administrator user
Enable “User Home”
Control Panel / User / Advanced, scroll down to “User Home”
Check “Enable user home service”, select an appropriate Location (i.e. volume1)
Click “Apply”
Create user account(s) that should access Synology via SSH (or via rsync over SSH), using the Synology web UI as normal.
Enable SSH for the Synology server