Skip to content

Instantly share code, notes, and snippets.

View oozman's full-sized avatar

Oozman oozman

View GitHub Profile
@oozman
oozman / tropo-scripting-on-gist
Last active December 16, 2015 04:29
GlobeLabs API
<?php
ask("What's your four or five digit pin? Press pound when finished", array(
"choices"=>"[4-5 DIGITS]",
"terminator" => "#",
"timeout" => 15.0,
"mode" => "dtmf",
"interdigitTimeout" => 5,
"onChoice" => "choiceFCN",
"onBadChoice" => "badChoiceFCN"
)
@oozman
oozman / shadow-text
Created May 9, 2013 08:44
A little subtle shadow on a text.
.shadow-text {
text-align: left;
color: #fff;
text-shadow: black 0.1em 0.1em 0.2em;
}
@oozman
oozman / dropdown-menu
Created May 27, 2013 01:09
A simple CSS-only dropdown menu.
.dropdown-menu {
list-style: none;
font-weight: bold;
width: 100%;
position: relative;
z-index: 5;
font-family: Sans-serif;
}
.dropdown-menu li {
float: left;
@oozman
oozman / fix-innodb-failed-xampp
Last active December 21, 2015 08:09
How to fix Plugin 'InnoDB' registration as a STORAGE ENGINE failed on XAMPP in Windows 8
I wrote an article about this on my blog, check it here:
http://omarusman.com/blog/tutorials/xampp-innodb-storage-engine-failed-windows8
@oozman
oozman / how-to-root-cherrymobile-thunder
Created September 8, 2013 10:57
How to root Cherry Mobile Thunder
Rooting Cherry Mobile Thunder
* Do this http://www.technodify.com/how-to-root-micromax-a91-and-cherry-mobile-thunder/
* Note: You need to copy Bin4ry file to C: and rename the folder to something else. ex: (rootandroid)
You need to run RunMe.bat as Administrator
* Install SQLITE for Root in Playstore
* Follow this http://forum.xda-developers.com/showthread.php?t=1835056
DB::enableQueryLog();
DB::listen(
function ($sql) {
// To save the executed queries to file:
// Process the sql and the bindings:
foreach ($sql->bindings as $i => $binding) {
if ($binding instanceof \DateTime) {
$sql->bindings[$i] = $binding->format('\'Y-m-d H:i:s\'');
} else {
@oozman
oozman / gist:8e78d465632745fd197eebe95239f176
Created July 20, 2016 04:37
[js] clean msword special characters
/// Replaces commonly-used Windows 1252 encoded chars that do not exist in ASCII or ISO-8859-1 with ISO-8859-1 cognates.
var replaceWordChars = function(text) {
var s = text;
// smart single quotes and apostrophe
s = s.replace(/[\u2018\u2019\u201A]/g, "\'");
// smart double quotes
s = s.replace(/[\u201C\u201D\u201E]/g, "\"");
// ellipsis
s = s.replace(/\u2026/g, "...");
// dashes
@oozman
oozman / directive.js
Last active August 18, 2017 03:26
ng-directive
/**
* Toast directive. Ex: <toast msg="Some message." style="success|info|warning|danger"></toast>
*/
.directive('toast', [function () {
return {
restrict: 'E',
template: function (elem, attr) {
return '<div class="toast">\n' +
' <div class="{{ style }}" role="alert">{{msg}}</div>\n' +
@oozman
oozman / miio
Last active September 25, 2017 12:54
MI Home Integration #api #nodejs
* Install miio library: https://github.com/aholstenson/miio
`node install -g miio`
* Get device token:
`miio --discover`
or use [python-mirobo](https://github.com/rytilahti/python-mirobo)
* See and follow miio library documentation.
@oozman
oozman / LongRunningGetIO
Created March 14, 2013 07:08
Getting data from API URL using GET in Android (AsyncTask). Credits: http://goo.gl/5hgFC
private class LongRunningGetIO extends AsyncTask <Void, Void, String>{
protected String getASCIIContentFromEntity(HttpEntity entity) throws IllegalStateException, IOException{
InputStream in = entity.getContent();
StringBuffer out = new StringBuffer();
int n = 1;
while (n>0) {
byte[] b = new byte[4096];
n = in.read(b);
if (n>0){