Skip to content

Instantly share code, notes, and snippets.

View shahariaazam's full-sized avatar
:octocat:
Open for opportunities

Shaharia Azam shahariaazam

:octocat:
Open for opportunities
View GitHub Profile
@shahariaazam
shahariaazam / sim_score.py
Created October 29, 2019 01:21 — forked from gibrown/sim_score.py
Simple graphing of Elasticsearch scoring functions.
from __future__ import division
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from pylab import *
import math
from scipy.stats import beta, norm, uniform
from scipy.special import betaln
from random import random, normalvariate
import numpy as np
<?php
// This uses the wpes-lib framework to build the index: https://github.com/automattic/wpes-lib
class WPOrg_Plugins_Index_Builder extends VIP_Index_Builder {
//override to add support for all analyzers
public function get_settings( $args ) {
$defaults = array(
);
$args = wp_parse_args( $args, $defaults );
@shahariaazam
shahariaazam / wordpress plugin rewrite media path
Last active April 5, 2017 21:47 — forked from mkdizajn/wordpress plugin rewrite media path
wordpress plugin rewrite media path
<?php
/*
Plugin Name: Rewrite Wordpress upload path
Plugin URI: http://mkdizajn.com
Description: Rewrites your image paths.
Version: 2.4
Author: kreso
Author URI: http://mkdizajn.com/
*/
@shahariaazam
shahariaazam / logstash_mongodb.rb
Created January 8, 2017 09:19 — forked from mohit/logstash_mongodb.rb
Parse MongoDB logs in logstash
filters {
grok {
type => "mongodb"
pattern => [ "%{DATA:mongo_ts} \[%{DATA:mongo_conn}\]? %{DATA:mongo_type} %{GREEDYDATA:mongo_message}" ]
}
mutate {
type => "mongodb"
replace => [ "@message", "%{mongo_message}" ]
}
grok {
@shahariaazam
shahariaazam / setup.md
Created October 29, 2016 23:04 — forked from xrstf/setup.md
Nutch 2.3 + ElasticSearch 1.4 + HBase 0.94 Setup

Info

This guide sets up a non-clustered Nutch crawler, which stores its data via HBase. We will not learn how to setup Hadoop et al., but just the bare minimum to crawl and index websites on a single machine.

Terms

  • Nutch - the crawler (fetches and parses websites)
  • HBase - filesystem storage for Nutch (Hadoop component, basically)
@shahariaazam
shahariaazam / PrivateTorrent.md
Created February 8, 2016 17:55 — forked from sourcec0de/PrivateTorrent.md
Host a private torrent tracker, and seed a torrent on ubuntu 12.10

Install dep, and start tracker

sudo apt-get install bittornado ctorrent
bttrack --port 6969 --dfile ~/.bttrack/dstate --logfile ~/.bttrack/tracker.log --nat_check 0 --scrape_allowed full

Now, create a torrent file

ctorrent -t -u "YOUR_SERVER_IP:6969/announce" -s new_file_name.torrent file_or_folder_for_torrent

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this-&gt;anything()
<?php
class ColorCLI {
static $foreground_colors = array(
'bold' => '1', 'dim' => '2',
'black' => '0;30', 'dark_gray' => '1;30',
'blue' => '0;34', 'light_blue' => '1;34',
'green' => '0;32', 'light_green' => '1;32',
'cyan' => '0;36', 'light_cyan' => '1;36',
# Apache config
<FilesMatch ".(eot|ttf|otf|woff)">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.