Skip to content

Instantly share code, notes, and snippets.

One coffee every five minute.

Anam Ahmed theanam

One coffee every five minute.
View GitHub Profile
milon /
Last active Jul 20, 2020
Install Elasticsearch on Laravel Homestead

Install Elasticsearch on Laravel Homestead

Install Java

sudo apt-get install openjdk-7-jre-headless -y

Download & install the Public Signing Key

wget -qO - | sudo apt-key add -
View gist:60c4fa9ca16a31ab8763
var counter = function(arg){
arg = arg == undefined ? 1 : arg;
var me = arguments.callee;
return me.count ? ( me.count += arg, me.count ) : ( me.count = arg, me );
var cnt = counter(5);
console.log(cnt(5)); //shud return 12
hasinhayder / enq-js.php
Last active Mar 4, 2016
generate wp_enqueue_script calls for all the js files in the current directory
View enq-js.php
#!/usr/bin/env php
foreach(glob("*.js") as $js){
echo "wp_enqueue_script( 'wptheme-{$js}', get_template_directory_uri().'/js/{$js}', array('jquery'),'1.0',true);\n";
lalinsky / ingest.php
Created Apr 18, 2012
Simple audio fingerprint matching in PHP
View ingest.php
include "utils.php";
$fp = parse_fp($_GET['fp']);
$dbh = new PDO('mysql:host=localhost;dbname=fingerprint', 'fingerprint');
$sth = $dbh->prepare("INSERT INTO fp (length) VALUES (?)");
You can’t perform that action at this time.