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
'use strict' | |
/* | |
first install the following node modules: | |
npm install aws-sdk | |
npm install stream | |
npm install speaker |
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
/* | |
use the following in your css file | |
.json-key { color: red; } | |
.json-value { color: blue; } | |
.json-string { color: green; } | |
set your output like this: |
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 | |
// for more info see : http://ucrel.lancs.ac.uk/llwizard.html | |
// $n1 = total words in corpus 1 (usually the normative corpus) | |
// $n2 = total words in corpus 2 | |
// $o1 = observed count for the word in corpus 1 (usually the normative corpus) | |
// $o2 = observed count for the word in corpus 2 | |
function logLikelihood ($n1, $o1, $n2, $o2) |
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 | |
function cleanse ($text) | |
{ | |
$text = iconv ('UTF-8', 'ASCII//TRANSLIT//IGNORE', $text); // accented character to 'normal' | |
$text = preg_replace ('/[\r\n\s\t]+/xms', ' ' , $text); // normalise whitespace to one space | |
$text = preg_replace ('/[^\w\s]+/xms' , '' , $text); // remove all punctuation | |
return strtolower (trim ($text)); // lowercase and trimmed | |
} |
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
'use strict' | |
/* | |
first install the following node modules: | |
npm install aws4 | |
npm install https | |
npm install querystring | |
npm install speaker | |
npm install lame |
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 | |
/* | |
* A super simple PHP file based cache for any data type or structure | |
* | |
* Released with the karmaware tag - https://pete-rai.github.io/karmaware | |
* | |
* Website : http://www.rai.org.uk | |
* GitHub : https://github.com/pete-rai | |
* LinkedIn : https://uk.linkedin.com/in/raipete |
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 | |
/* | |
* A simple PHP logger class with timestamps and trace support | |
* | |
* Released with the karmaware tag - https://pete-rai.github.io/karmaware | |
* | |
* Website : http://www.rai.org.uk | |
* GitHub : https://github.com/pete-rai | |
* LinkedIn : https://uk.linkedin.com/in/raipete |
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 | |
/* | |
* A simple PHP wrapper around the Twitter API with full authorization support | |
* | |
* Released with the karmaware tag - https://pete-rai.github.io/karmaware | |
* | |
* Website : http://www.rai.org.uk | |
* GitHub : https://github.com/pete-rai | |
* LinkedIn : https://uk.linkedin.com/in/raipete |
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
<? | |
/* | |
* A simple PHP timer class with interim marker support | |
* | |
* Released with the karmaware tag - https://pete-rai.github.io/karmaware | |
* | |
* Website : http://www.rai.org.uk | |
* GitHub : https://github.com/pete-rai | |
* LinkedIn : https://uk.linkedin.com/in/raipete |
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 | |
/* | |
* A simple PHP file based cache with support for cache expiry and storing any data type or structure | |
* | |
* Released with the karmaware tag - https://pete-rai.github.io/karmaware | |
* | |
* Website : http://www.rai.org.uk | |
* GitHub : https://github.com/pete-rai | |
* LinkedIn : https://uk.linkedin.com/in/raipete |
OlderNewer