How to add a 32M query cache with an item limit of 1M.
NOTE: You might need to add '-p' to the following command if 'root'@'localhost' requires a password on your environment.
# mysql \
/** | |
* Scope a query to only include models matching the supplied ID or UUID. | |
* Returns the model by default, or supply a second flag `false` to get the Query Builder instance. | |
* | |
* @throws \Illuminate\Database\Eloquent\ModelNotFoundException | |
* | |
* @param \Illuminate\Database\Schema\Builder $query The Query Builder instance. | |
* @param string $uuid The UUID of the model. | |
* @param bool|true $first Returns the model by default, or set to `false` to chain for query builder. | |
* @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Builder |
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
class RewriteLinks | |
{ | |
/** | |
* Handle an incoming request. |
// XMLHttpRequest | |
var xhr = new XMLHttpRequest(); | |
xhr.open('POST', url, true); | |
xhr.responseType = 'arraybuffer'; | |
xhr.onload = function () { | |
if (this.status === 200) { | |
var filename = ""; | |
var disposition = xhr.getResponseHeader('Content-Disposition'); | |
if (disposition && disposition.indexOf('attachment') !== -1) { | |
var filenameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/; |
<?php | |
/************************************************************************* | |
* Get File Information | |
*/ | |
// Assuming these come from some data source in your app | |
$s3FileKey = 's3/key/path/to/file.ext'; | |
$fileName = 'file.ext'; |
// only for desktop for now, | |
@media screen and (min-width: 1008px) { | |
/* during entering and leaving : */ | |
.page-enter-active, .page-leave-active { | |
position:absolute; | |
max-width:725.328px; /*make sur our content keep it's original width*/ | |
transition: all .2s ease; | |
} |
<?php | |
/** | |
* NuxtValetDriver for running compiled nuxt.js sites | |
*/ | |
class NuxtValetDriver extends BasicValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. | |
* |
This is a considerably faster, but much more basic alternative to bash-git-prompt.
When adding this script to your .bash_profile
or .bashrc
, it'll display the selected branch of the current folder (if it's a git repo), and whether it's modified (yellow) or contains staged files (cyan).
The script makes the assumption, that a .git
folder only exists when the directory is a git repo. Also, it checks for the english version of the git status
command, so if you're using git in a different locale, make sure to adjust this.
#!/bin/bash | |
# Creator: Phil Cook | |
# Modified: Andy Miller | |
# | |
# >>> IMPORTANT: Moved to: https://github.com/rhukster/sphp.sh | |
# >>> Kept here for legacy purposes | |
# | |
osx_major_version=$(sw_vers -productVersion | cut -d. -f1) | |
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2) | |
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3) |
In console: | |
git config credential.helper | |
You will see: osxkeychain | |
git config credential.helper sourcetree | |
Then if you perform git config credential.helper again | |
You will see: sourcetree |