Skip to content

Instantly share code, notes, and snippets.

View rtuin's full-sized avatar
😃
Hi!

Richard Tuin rtuin

😃
Hi!
View GitHub Profile
@rtuin
rtuin / gist:5028719
Last active April 11, 2024 14:57
400 Bad Request
To the tune of Lady Gaga - Bad Romance
http://www.youtube.com/watch?v=qrO4YZeyl0I
Oh, caught in a bad request
Oh, caught in a bad request
Rah, rah, oh, oh, oh
Roma, roma, ma
Gaga, ooh, la, la
Received a bad request
@rtuin
rtuin / HTML5 Skeleton template.html
Created March 25, 2011 22:06
HTML5 skeleton template
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
@rtuin
rtuin / detect-if-emulator.js
Last active July 15, 2018 21:56
Titanium: Detect whether you're running in an emulator or not.
// Detect whether we're running inside a simulator or not.
// Put this in your app.js or alloy.js
function isEmulator() {
return (Ti.Platform.manufacturer == 'Genymotion' || Ti.Platform.model == 'Simulator');
}
// Use it to create mocks, for example:
function Foo() {
this.init();

Keybase proof

I hereby claim:

  • I am rtuin on github.
  • I am rtuin (https://keybase.io/rtuin) on keybase.
  • I have a public key ASA4tEyxdNOO-yCgRjaKEUGEBS8XRb1xo5eaMr5b6gaiAAo

To claim this, I am signing this object:

snc_redis:
clients:
doctrine_meta:
type: phpredis
alias: doctrine_meta
dsn: redis://localhost/2
doctrine:
metadata_cache:
client: doctrine_meta
entity_manager: default # the name of your entity_manager connection
<?php
foreach ($someArray as $value) {
if (isSomething($value)) {
$output->writeln("It's true!");
} else {
$output->writeln("It's false!");
}
}
<?php
// Example: Iterate over all resources from a paginated API endpoint
// PHP 5 vs PHP 7
// Both examples iterate over records like this:
foreach (findAll() as $row) {
// Handle $row
}

Google Speech To Text API

Base URL: https://www.google.com/speech-api/v1/recognize
It accepts POST requests with voice file encoded in FLAC format, and query parameters for control.

Query Parameters

client
The client's name you're connecting from. For spoofing purposes, let's use chromium

lang
Speech language, for example, ar-QA for Qatari Arabic, or en-US for U.S. English

${WORKSPACE}/bin/behat --format junit --out ${WORKSPACE}/build
build/*.xml