Skip to content

Instantly share code, notes, and snippets.

View fizerkhan's full-sized avatar

Fizer Khan (பைசர் கான்) fizerkhan

View GitHub Profile
@fizerkhan
fizerkhan / install-gcc48-linuxbrew-centos6.md
Last active September 25, 2017 12:06 — forked from stephenturner/install-gcc48-linuxbrew-centos6.md
Installing gcc 4.8 and Linuxbrew on CentOS 6

Installing gcc 4.8 and Linuxbrew on CentOS 6

The GCC distributed with CentOS 6 is 4.4.7, which is pretty outdated. I'd like to use gcc 4.8+. Also, when trying to install Linuxbrew you run into a dependency loop where Homebrew's gcc depends on zlib, which depends on gcc. Here's how I solved the problem.

Note: Requires sudo privileges.

Resources:

@fizerkhan
fizerkhan / app.js
Created June 7, 2017 07:32
Atatus Node Agent with ES6
import http from 'http';
import express from 'express';
import morgan from 'morgan';
import bodyParser from 'body-parser';
let app = express();
app.server = http.createServer(app);
app.use(morgan('dev'));
app.use(bodyParser.json({}));
// PDO Connection to MySQL
$conn = new PDO('mysql:host=localhost;dbname=yourdbname', 'username', 'password');
// PDO Connection to PostgreSQL
$conn = new PDO('pgsql:host=localhost;dbname=yourdbname', 'username', 'password');
// A quick Select Query with For Loop
foreach ($conn->query("SELECT * FROM profile") as $row)
echo $row['fullname'];
@fizerkhan
fizerkhan / FeedlyCenteredSlider.user.js
Created March 16, 2017 11:58 — forked from TheBronx/FeedlyCenteredSlider.user.js
Centers the new slider on Feedly
// ==UserScript==
// @name Feedly Centered Slider
// @namespace http://salvatorelab.es
// @version 2.0
// @description Centers the slider on Feedly
// @match http://feedly.com/*
// @grant GM_addStyle
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
// ==/UserScript==
@fizerkhan
fizerkhan / index.js
Last active January 5, 2017 17:25
AtatusJS Redux Middleware
// Add atatus middlware to your redux store
import atatusMiddleware from './redux-atatus-middleware';
createStore(
rootReducer,
initialState,
applyMiddleware(atatusMiddleware())
);
# -*- coding: utf-8 -*-
import itertools
import re
import urlparse
import boto
import warc
from boto.s3.key import Key
from gzipstream import GzipStreamFile
@fizerkhan
fizerkhan / alexa.js
Created November 27, 2016 09:55 — forked from chilts/alexa.js
Getting the Alexa top 1 million sites directly from the server, unzipping it, parsing the csv and getting each line as an array.
var request = require('request');
var unzip = require('unzip');
var csv2 = require('csv2');
request.get('http://s3.amazonaws.com/alexa-static/top-1m.csv.zip')
.pipe(unzip.Parse())
.on('entry', function (entry) {
entry.pipe(csv2()).on('data', console.log);
})
;
@fizerkhan
fizerkhan / sourcemap-checker.js
Last active October 31, 2016 11:41
Validate and get actual line number of the stacktrace using source map
//
// Purpose:
//
// To validate the source map
// To get actual line number of the stack trace
//
// Usage:
// You need to do following
//
// 1. Copy the source map to the directory where you have this script.
@fizerkhan
fizerkhan / Install AtatusJS Agent
Last active July 14, 2018 06:10
Atatus Angular 2+ Integrations
npm install atatus-js --save
@fizerkhan
fizerkhan / keybase.md
Created July 16, 2016 07:11
keybase.md

Keybase proof

I hereby claim:

  • I am fizerkhan on github.
  • I am fizerkhan (https://keybase.io/fizerkhan) on keybase.
  • I have a public key whose fingerprint is FC70 6E02 CFA6 C972 4445 A535 D8C5 19A3 CCA5 DA5D

To claim this, I am signing this object: