Skip to content

Instantly share code, notes, and snippets.

Avatar
One coffee every five minute.

Anam Ahmed theanam

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

Install Elasticsearch on Laravel Homestead

Install Java

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

Download & install the Public Signing Key

wget -qO - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | 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);
cnt();
cnt();
console.log(cnt(5)); //shud return 12
@hasinhayder
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
<?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
lalinsky / ingest.php
Created Apr 18, 2012
Simple audio fingerprint matching in PHP
View ingest.php
<?php
include "utils.php";
$fp = parse_fp($_GET['fp']);
$dbh = new PDO('mysql:host=localhost;dbname=fingerprint', 'fingerprint');
$dbh->beginTransaction();
$sth = $dbh->prepare("INSERT INTO fp (length) VALUES (?)");
You can’t perform that action at this time.