Skip to content

Instantly share code, notes, and snippets.

@mp3063
mp3063 / Countdown
Created February 13, 2017 01:14
Simple countdown timer
var count=30;
var counter=setInterval(timer, 1000); //1000 will run it every 1 second
function timer()
{
count=count-1;
if (count <= 0)
{
clearInterval(counter);
@mp3063
mp3063 / read-ms-office.php
Created February 11, 2017 20:10
extract text from doc, docx, xlsx and pptx files
class DocxConversion{
private $filename;
public function __construct($filePath) {
$this->filename = $filePath;
}
private function read_doc() {
$fileHandle = fopen($this->filename, "r");
$line = @fread($fileHandle, filesize($this->filename));
function palindrome(str) {
var punct = str.replace(/[.,-\/#!$%\^&\*;:{}=\-_`~()]/g, "").split(' ').join('').toLowerCase();
var string = punct.split('').reverse().join('').replace(/[.,-\/#!$%\^&\*;:{}=\-_`~()]/g, "");
if (punct == string) {
return true;
}
else {
return false;
}
}