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 / ZIPMaker.php
Created February 3, 2013 17:43
Create .ZIP archive in PHP
<?php
/**
* @Author Shaharia Azam
* @Author URL http://www.shahariaazam.com
*
* @Description this function will make a .zip folder by adding multiple files.
* @link http://php.net/manual/en/book.zip.php
*
* @param array $SourceFiles
* @param string $ZipDestination
@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 / gist:41c61215a7995c15ede777c45190a458
Created August 6, 2018 13:50
Google App Engine _ IP Ranges
8.34.208.0/20, 8.35.192.0/21, 8.35.200.0/23, 108.59.80.0/20, 108.170.192.0/20, 108.170.208.0/21, 108.170.216.0/22, 108.170.220.0/23, 108.170.222.0/24, 35.224.0.0/13, 162.216.148.0/22, 162.222.176.0/21, 173.255.112.0/20, 192.158.28.0/22, 199.192.112.0/22, 199.223.232.0/22, 199.223.236.0/23, 23.236.48.0/20, 23.251.128.0/19, 35.204.0.0/14, 35.208.0.0/14, 107.167.160.0/19, 107.178.192.0/18, 146.148.2.0/23, 146.148.4.0/22, 146.148.8.0/21, 146.148.16.0/20, 146.148.32.0/19, 146.148.64.0/18, 35.203.0.0/17, 35.203.128.0/18, 35.203.192.0/19, 35.203.240.0/20, 130.211.8.0/21, 130.211.16.0/20, 130.211.32.0/19, 130.211.64.0/18, 130.211.128.0/17, 104.154.0.0/15, 104.196.0.0/14, 208.68.108.0/23, 35.184.0.0/14, 35.188.0.0/15, 35.202.0.0/16, 35.190.0.0/17, 35.190.128.0/18, 35.190.192.0/19, 35.235.224.0/20, 35.192.0.0/14, 35.196.0.0/15, 35.198.0.0/16, 35.199.0.0/17, 35.199.128.0/18, 35.200.0.0/15
@shahariaazam
shahariaazam / ThemeForestThemeStatisticsAndInformation.php
Last active December 10, 2017 07:57
Get ThemeForest theme statistics and information in simple PHP script
<?php
/**
* ThemeForest specific theme information with Theme details, Total Sell Count, Total Comments, etc..
*
* encouraged by @sohelrana820 & @aislamfaisal on a chitchat
*
* @autho: Shaharia Azam <shaharia.azam@gmail.com>
* @url: https://blog.shaharia.com
*
*
@shahariaazam
shahariaazam / GitHub-bulk-issue-import.php
Created December 3, 2013 01:12
Bulk Issue create or Import from a Json files
<?php
// This file is generated by Composer
require_once 'vendor/autoload.php';
$client = new \Github\Client();
$client->authenticate('githubusername', 'githubpassword', Github\Client::AUTH_HTTP_PASSWORD);
/*$repositories = $issue = $client->api('issue')->all('shahariaazam', 'cakephp-quick-start');
//var_dump($repositories); die();*/
@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 {
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Polygon Arrays</title>
<style>
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
@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)