This file contains hidden or 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
{ | |
"hypotheses": [ | |
{ | |
"confidence": 0.88569070000000005, | |
"utterance": "this is pretty cool" | |
}, | |
{ | |
"utterance": "thesis pretty cool" | |
}, | |
{ |
This file contains hidden or 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
const int SpeechRecognizer::kAudioSampleRate = 16000; | |
const int SpeechRecognizer::kAudioPacketIntervalMs = 100; | |
const ChannelLayout SpeechRecognizer::kChannelLayout = CHANNEL_LAYOUT_MONO; | |
const int SpeechRecognizer::kNumBitsPerAudioSample = 16; | |
const int SpeechRecognizer::kNoSpeechTimeoutSec = 8; | |
const int SpeechRecognizer::kEndpointerEstimationTimeMs = 300; | |
// ... | |
const char* const kContentTypeSpeex = "audio/x-speex-with-header-byte; rate="; | |
const int kSpeexEncodingQuality = 8; | |
const int kMaxSpeexFrameLength = 110; // (44kbps rate sampled at 32kHz). |
This file contains hidden or 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 | |
# FLAC encoded example | |
curl \ | |
--data-binary @example.flac \ | |
--header 'Content-type: audio/x-flac; rate=16000' \ | |
'https://www.google.com/speech-api/v1/recognize?xjerr=1&client=chromium&pfilter=2&lang=en-US&maxresults=6' | |
# Speex encoded example | |
curl \ |
This file contains hidden or 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: Disable plugins when doing local dev | |
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify | |
Version: 0.1 | |
License: GPL version 2 or any later version | |
Author: Mark Jaquith | |
Author URI: http://coveredwebservices.com/ | |
*/ |
This file contains hidden or 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: Comment meta data test | |
Version: 1.0 | |
Plugin URI: http://wpengineer.com | |
Description: Comment meta data test | |
Author: Latz | |
Author URI: http://wpengineer.com | |
*/ |
This file contains hidden or 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
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase /path/to/front/of/site/under/root/directory/local_example_com/ | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /path/to/front/of/site/under/root/directory/local_example_com/index.php [L] | |
</IfModule> |
This file contains hidden or 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 | |
// Change /*CUSTOMIZE_THIS*/ to a unique name (two places). Go ahead, make it long. | |
// Like, your initials, and your full plugin name. | |
// e.g. MTJ_Some_Awesome_Plugin_Controller | |
/*CUSTOMIZE_THIS*/_Controller::init(); | |
class /*CUSTOMIZE_THIS*/_Controller { | |
function init() { |
This file contains hidden or 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 | |
$url = "http://icanhascheezburger.com"; | |
$html = file_get_contents($url); | |
$dom = new DomDocument(); | |
@$dom->loadHTML($html); | |
$xpath = new DOMXPath($dom); | |
$img = $xpath->evaluate("//div[@class='entry']//img")->item(0); | |
$imgSrc = $img->getAttribute('src'); | |
print("<img src=\"$imgSrc\" />"); |
This file contains hidden or 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 | |
$weather_loc = 10001; | |
function getWeather( $weather_loc ) { | |
// weather data url, location based | |
$requestAddress = 'http://www.google.com/ig/api?weather=$weather_loc&hl=en'; | |
// Parse XML | |
$xml_str = file_get_contents($requestAddress,0); |
This file contains hidden or 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 | |
/** | |
* Adds a view all posts page to any archive. | |
* | |
* @author Thomas Scholz http://toscho.de | |
* @version 1.1 | |
* @license: GPL2 | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html |