Skip to content

Instantly share code, notes, and snippets.

View oozman's full-sized avatar

Oozman oozman

View GitHub Profile
@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
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 / 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
@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 / 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 / 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 / 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"
)