- Open Automator
- Create a new document
- Select Quick Action
- Set “Service receives selected” to
files or folders
inany application
- Add a
Run Shell Script
action- your default shell should already be selected, otherwise use
/bin/zsh
for macOS 10.15 (”Catalina”) or later - older versions of macOS use
/bin/bash
- your default shell should already be selected, otherwise use
- if you're using something else, you probably know what to do 😉
# SSH into droplet | |
# go to project | |
$ php artisan tinker | |
$ Mail::send('errors.401', [], function ($message) { $message->to('emmanuelbarturen@gmail.com')->subject('this works!'); }); | |
# check your mailbox |
<?php | |
class PaystackFees | |
{ | |
const DEFAULT_PERCENTAGE = 0.015; | |
const DEFAULT_ADDITIONAL_CHARGE = 10000; | |
const DEFAULT_THRESHOLD = 250000; | |
const DEFAULT_CAP = 200000; | |
public static $default_percentage = PaystackFees::DEFAULT_PERCENTAGE; |
Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.
You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).
Use ssh keys and define host aliases in ssh config file (each alias for an account).
<?php | |
/** | |
* BBcode helper class | |
* | |
* @package BBcode | |
* @category Helper | |
* @author Chema <chema@garridodiaz.com> | |
* @copyright (c) 2012 | |
* @license GPL v3 | |
*/ |
<?php | |
function json_response($code = 200, $message = null) | |
{ | |
// clear the old headers | |
header_remove(); | |
// set the actual code | |
http_response_code($code); | |
// set the header to make sure cache is forced | |
header("Cache-Control: no-transform,public,max-age=300,s-maxage=900"); |
<?php | |
// From a StackOverflow answer... | |
// I can't find the original link :-( | |
class StringEncryption { | |
const ENCRYPTION_KEY = "She's a killer queeeeeeeeen!"; | |
public function encode($url = '') { | |
return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5(self::ENCRYPTION_KEY), $url, MCRYPT_MODE_CBC, md5(md5(self::ENCRYPTION_KEY)))); | |
} |