This file contains 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
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){ |
This file contains 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 | |
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" | |
) |
This file contains 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
Step 1: | |
Go to: C:\Windows\System32\Drivers\etc\hosts | |
And add this to the bottom of the file: | |
============= | |
127.0.0.1 your.domain.com | |
============= | |
Step 2: | |
Go to [your XAMPP directory]/apache/conf/httpd-xampp.conf |
This file contains 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
.shadow-text { | |
text-align: left; | |
color: #fff; | |
text-shadow: black 0.1em 0.1em 0.2em; | |
} |
This file contains 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
I wrote an article about this on my blog, check it here: | |
http://omarusman.com/blog/tutorials/xampp-innodb-storage-engine-failed-windows8 |
This file contains 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
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 |
This file contains 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
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 { |
This file contains 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
/// 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 |
This file contains 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
How to install and run Headless nightmare.js based scripts in Ubuntu. | |
Steps: | |
1. Spin Ubuntu 16.04 x64 server | |
2. Run: apt-get update | |
3. Run: apt-get upgrade | |
4. Run: apt-get install -y libgtk2.0-0 libgconf-2-4 libasound2 libxtst6 libxss1 libnss3 xvfb | |
5. Install Node.js 6+. See: https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions | |
You can then run your script using this command: |
OlderNewer