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
// Scraping Made Easy with jQuery and SelectorGadget
// (http://blog.dtrejo.com/scraping-made-easy-with-jquery-and-selectorga)
// by David Trejo
//
// Install node.js and npm:
// http://joyeur.com/2010/12/10/installing-node-and-npm/
// Then run
// npm install jsdom jquery http-agent
// node numresults.js
//
<html>
<head>
<title>Hello World</title>
<link rel="stylesheet" href="styles/default.css">
<link rel="alternate stylesheet" href="styles/arta.css" title="arta">
<link rel="alternate stylesheet" href="styles/ascetic.css" title="ascetic">
<link rel="alternate stylesheet" href="styles/brown_paper.css" title="brown_paper">
<link rel="alternate stylesheet" href="styles/dark.css" title="dark">
<link rel="alternate stylesheet" href="styles/far.css" title="far">
<link rel="alternate stylesheet" href="styles/github.css" title="github">
<?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.
# Apache config
<FilesMatch ".(eot|ttf|otf|woff)">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
<?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',

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this-&gt;anything()
@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
@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 / 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 / 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/
*/