Skip to content

Instantly share code, notes, and snippets.

View joshbuchea's full-sized avatar

Josh Buchea joshbuchea

View GitHub Profile
@joshbuchea
joshbuchea / ios-speechsynthesizer-langs.js
Created December 11, 2015 01:01
iOS SpeechSynthesizer Support Langues
{
'ar-SA': {locale: 'ar-SA', name: 'Arabic (Saudi Arabia)'},
'zh-CN': {locale: 'zh-CN', name: 'Chinese (China)'},
'zh-HK': {locale: 'zh-HK', name: 'Chinese (Hong Kong SAR China)'},
'zh-TW': {locale: 'zh-TW', name: 'Chinese (Taiwan)'},
'cs-CZ': {locale: 'cs-CZ', name: 'Czech (Czech Republic)'},
'da-DK': {locale: 'da-DK', name: 'Danish (Denmark)'},
'nl-BE': {locale: 'nl-BE', name: 'Dutch (Belgium)'},
'nl-NL': {locale: 'nl-NL', name: 'Dutch (Netherlands)'},
'en-AU': {locale: 'en-AU', name: 'English (Australia)'},
@joshbuchea
joshbuchea / cordova-get-media-url.js
Last active February 19, 2016 21:31
Cordova getMediaURL() func
function getMediaURL(s) {
if(device.platform.toLowerCase() === "android") return "/android_asset/www/" + s;
return s;
}
@joshbuchea
joshbuchea / force-lowercase-urls.php
Created October 18, 2015 06:28
A function to redirect uppercase URLs to lowercase.
/**
* Changes the requested URL to lowercase.
*
* Only if URL does not include a filename or query variable.
*/
function force_lowercase_urls() {
// Grab requested URL
$url = $_SERVER['REQUEST_URI'];
// If URL contains a period, halt (likely contains a filename and filenames are case specific)
if ( preg_match('/[\.]/', $url) ) {
@joshbuchea
joshbuchea / bootstrap-starter.html
Last active April 19, 2016 05:34
Bootstrap starter template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Bootstrap Starter Template</title>
<!-- Bootstrap -->
@joshbuchea
joshbuchea / android-expansion-steps.md
Last active October 2, 2017 12:28
Steps to get cordova-plugin-xapkreader working with Ionic/Cordova 5 project
@joshbuchea
joshbuchea / cordova-default-csp.xml
Last active August 29, 2015 14:27
Cordova sensible Content-Security-Policy defaults
<meta http-equiv="Content-Security-Policy" content="
default-src 'self' data: gap: https://ssl.gstatic.com;
script-src 'self' 'unsafe-inline' 'unsafe-eval';
style-src 'self' 'unsafe-inline';
img-src 'self' data:;
media-src *;">
@joshbuchea
joshbuchea / 0_reuse_code.js
Last active August 29, 2015 14:27
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@joshbuchea
joshbuchea / .gitignore
Last active August 29, 2015 14:26 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@joshbuchea
joshbuchea / plist-to-json.sh
Created July 28, 2015 00:06
A shell script for Automator that can convert .plist to .json file.
for f in "$@"
do
filename="${f%.*}"
plutil -convert json "$filename".plist -o "$filename".json
done

Elevator Hack

This elevator "hack" will allow you to go immediately to your destination floor, bypassing all previously queued floors.

  1. Press & hold close door button until doors close. Keep holding.
  2. Press floor # button and do not release close door button until elevator moves.

Note: One LifeHacker commenter said: "it is completely dependant on the Logic Controller being used in the motor room of the elevator, as this trick does not work on older elevators".

To Do