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
file, err := os.Open(path) | |
if err != nil { | |
return err | |
} | |
defer file.Close() | |
// Only the first 512 bytes are used to sniff the content type. | |
buffer := make([]byte, 512) | |
_, err = file.Read(buffer) | |
if err != nil { |
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
36 Bass | |
37 Bass alt. | |
38 Snare | |
39 Snare (Rim Hit) | |
40 Rim Click | |
41 Rim Click Alt. | |
42 High-Hat Closed | |
43 Floor Tom | |
44 High-Hat Half Open | |
45 Mid Tom |
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
echo -n "$(cat private.key)" | base64 | tr -d '\n' | pbcopy |
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 | |
/** | |
* @wordpress-plugin | |
* Plugin Name: Search by Algolia for WooCommerce - Instant & Relevant results | |
*/ | |
/** | |
* If Algolia is not active, let users know. |
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 | |
$data = <<< EOF | |
The broken serialized data goes here. | |
And can expand on multiple lines. | |
EOF; | |
$data = preg_replace_callback ('!s:(\d+):"(.*?)";!', function($match) { | |
return ($match[1] == strlen($match[2])) ? $match[0] : 's:' . strlen($match[2]) . ':"' . $match[2] . '";'; | |
}, $data); |
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 | |
add_filter( 'algolia_autocomplete_config', function ( $config ) { | |
if (true) { // Replace this condition to match your needs. | |
// Autocomplete enabled. | |
return $config | |
} | |
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 | |
// functions.php | |
define( 'CUSTOM_HOME_ID', 2 ); | |
function custom_should_index_post( $flag, WP_Post $post ) { | |
if ( $post->post_type === 'page' && $post->ID === CUSTOM_HOME_ID ) { | |
return false; | |
} | |
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
kubectl get pod -a --all-namespaces -o json \ | |
| jq '.items[] | select(.status.reason!=null) | select(.status.reason | contains("Evicted")) | "kubectl delete pod \(.metadata.name) -n \(.metadata.namespace)"' \ | |
| xargs -n 1 bash -c |
NewerOlder