This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This is a port of Ken Perlin's "Improved Noise" | |
// http://mrl.nyu.edu/~perlin/noise/ | |
// Originally from http://therandomuniverse.blogspot.com/2007/01/perlin-noise-your-new-best-friend.html | |
// but the site appears to be down, so here is a mirror of it | |
class Perlin { | |
var $p, $permutation, $seed; | |
var $_default_size = 64; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $# -eq 0 ]] ; then | |
echo "Please enter a version number:" | |
read VERSION | |
else | |
VERSION=$1 | |
fi | |
if [[ -z "$VERSION" ]] ; then | |
echo "Sorry, I need a version number!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# WHOIS servers for new TLDs (http://www.iana.org/domains/root/db) | |
# Current as of 2017-12-10 UTC | |
## | |
\.aarp$ whois.nic.aarp | |
\.abarth$ whois.afilias-srs.net | |
\.abbott$ whois.afilias-srs.net | |
\.abbvie$ whois.afilias-srs.net | |
\.abc$ whois.nic.abc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* | |
* You just need to configure the $limits array. The elements are level ID - 1. So, if your level ID 1, the index will be 0. | |
* Then for product index add the limit | |
* | |
*/ | |
$limits = array( | |
'0' => array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
... | |
if ( version_compare( '5.3', phpversion(), '>' ) ) { | |
add_action( 'admin_notices', '_myplugin_php_notice' ); | |
// Do what you need to stop your plugin from loading | |
} | |
/** | |
* Displays an admin error about needing to update the server's PHP version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Whitelist embedded links in the REST API responses | |
* | |
* This is often useful if you want to only get specified resources embedded along with the | |
* main resources, rather than the "all of nothing" approach of passing `?_embed` to the API request. | |
* | |
* You can either pass a comma seperated list of relationships or an array of string via the `_embed_include` query param. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cacheFirstGet(ref, handlerFunc, timeout = 10000) { | |
let options = {}; | |
if (ref instanceof firebase.firestore.DocumentReference) { | |
options.includeMetadataChanges = true; | |
} else if (ref instanceof firebase.firestore.Query) { | |
options.includeQueryMetadataChanges = true; | |
} else { | |
throw new Error("Input must implement DocumentReference or Query"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: WPS Custom Block Patterns | |
Description: Adds a custom block pattern to the Gutenberg block editor. | |
Version: 1.0 | |
Author: Chris Romero | |
Author URI: https://cromero.io | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* By default, cURL sends the "Expect" header all the time which severely impacts | |
* performance. Instead, we'll send it if the body is larger than 1 mb like | |
* Guzzle does. | |
*/ | |
function add_expect_header(array $arguments) | |
{ | |
$arguments['headers']['expect'] = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Clone llama.cpp | |
git clone https://github.com/ggerganov/llama.cpp.git | |
cd llama.cpp | |
# Build it | |
make clean | |
LLAMA_METAL=1 make | |
# Download model | |
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin |
OlderNewer