/Applications/Spotify.app/Contents/Resources/Spotify.sdef
# read-only
osascript -e 'tell application "Spotify" to player state' # stopped,playing,paused
osascript -e 'tell application "Spotify" to current track' # The current playing track.
osascript -e 'tell application "Spotify" to artwork url of current track' # Image data in TIFF format.
osascript -e 'tell application "Spotify" to artist of current track' # The artist of the track.
<?php | |
use Illuminate\Database\Migrations\Migration; | |
return new class extends Migration { | |
public function up(): void | |
{ | |
$this->migrateCharsetTo('utf8mb4', 'utf8mb4_unicode_ci'); | |
} |
#!/bin/bash | |
sudo pkill -9 OneDrive | |
sudo rm -rf /Applications/OneDrive.app/ | |
sudo rm /Library/LaunchAgents/com.microsoft.OneDriveStandaloneUpdater.plist | |
sudo rm /Library/LaunchDaemons/com.microsoft.OneDriveStandaloneUpdaterDaemon.plist | |
sudo rm /Library/LaunchDaemons/com.microsoft.OneDriveUpdaterDaemon.plist | |
sudo rm -rf /Library/Logs/Microsoft/OneDrive | |
sudo rm /private/var/db/receipts/com.microsoft.OneDrive-mac.bom |
#battery | |
sudo pmset -b standbydelaylow 300 | |
sudo pmset -b standby 1 | |
sudo pmset -b halfdim 1 | |
sudo pmset -b sms 0 | |
sudo pmset -b disksleep 10 | |
sudo pmset -b standbydelayhigh 600 | |
sudo pmset -b sleep 10 | |
sudo pmset -b autopoweroffdelay 40000 | |
sudo pmset -b hibernatemode 25 |
<?php | |
use Illuminate\Support\Facades\Schema; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class MigrateToUtf8mb4 extends Migration | |
{ | |
/** | |
* Run the migrations. |
#!/bin/bash | |
export AnException=100 | |
export AnotherException=101 | |
# start with a try | |
try | |
( # open a subshell !!! | |
echo "do something" | |
[ someErrorCondition ] && throw $AnException |
I recently ran into a problem where I had a suite of applications hosted on a set of subdomains that all needed to be able to share a single cookie. Any cookies other than the shared cookie needed to stay specific to their subdomain, but this one shared cookie needed to be accessible to any of them. I also wanted to accomplish this using Laravel's Cookie
facade.
To accomplish this, there were two issues to solve.
- All cookies created by the Laravel framework are encrypted by default. (link)
- I needed to figure out how to set a domain on the shared cookie that was different than the domain it was being set from.
In Laravel 5.1, a feature was added which allows you to add a list of cookie names that should not be encrypted to the EncryptCookies
Middleware under the $except
array. Check out [the docs](http://laravel.com/docs/5.1/responses#attaching-cookies
##### setup start | |
BATS_TEST_NAME: test_example_status_and_output-2c_lines | |
BATS_TEST_FILENAME: /home/bats/test.bats | |
BATS_TEST_DIRNAME: /home/bats | |
BATS_TEST_NAMES: test_example_status_and_output-2c_lines | |
BATS_TEST_DESCRIPTION: example status and output, lines | |
BATS_TEST_NUMBER: 1 | |
BATS_TMPDIR: /tmp | |
##### setup end | |
example 1 |
A git choose-your-own-adventure!
This document is an attempt to be a fairly comprehensive guide to recovering from what you did not mean to do when using git. It isn't that git is so complicated that you need a large document to take care or your particular problem, it is more that the set of things that you might have done is so large that different techniques are needed depending on exactly what you have done and what you want to have happen.