Skip to content

Instantly share code, notes, and snippets.

Avatar

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

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

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 Jun 7, 2017
Atatus Node Agent with ES6
View app.js
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({}));
View gist:d858614e264394736e9f4921e809b27d
// 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'];
View FeedlyCenteredSlider.user.js
// ==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 Jan 5, 2017
AtatusJS Redux Middleware
View index.js
// Add atatus middlware to your redux store
import atatusMiddleware from './redux-atatus-middleware';
createStore(
rootReducer,
initialState,
applyMiddleware(atatusMiddleware())
);
View mr_crawl_phonenumbers.py
# -*- 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 Nov 27, 2016 — 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.
View alexa.js
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 Oct 31, 2016
Validate and get actual line number of the stacktrace using source map
View sourcemap-checker.js
//
// 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 Jul 14, 2018
Atatus Angular 2+ Integrations
View Install AtatusJS Agent
npm install atatus-js --save
View 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: