Skip to content

Instantly share code, notes, and snippets.

View fizerkhan's full-sized avatar

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

View GitHub Profile
@fizerkhan
fizerkhan / AwaitingReply.gs
Created January 17, 2018 18:11 — forked from colinloretz/AwaitingReply.gs
AwaitingReply
function label_awaiting_reply() {
var emailAddress = Session.getEffectiveUser().getEmail();
Logger.log(emailAddress);
var EMAIL_REGEX = /[a-zA-Z0-9\._\-]+@[a-zA-Z0-9\.\-]+\.[a-z\.A-Z]+/g;
var label = GmailApp.createLabel("AwaitingReply");
var d = new Date();
d.setDate(d.getDate() - 7);
var dateString = d.getFullYear() + "/" + (d.getMonth() + 1) + "/" + d.getDate();
threads = GmailApp.search("in:Sent after:" + dateString);
for (var i = 0; i < threads.length; i++)
@fizerkhan
fizerkhan / Email-verifier.js
Created October 20, 2017 09:55 — forked from augfrank/Email-verifier.js
Google Sheet script to verify email addresses automatically
/**
* A custom function that verifies an email ID
*
* @param {String} email ID
* @return {Boolean} If the email ID is active
* @customfunction
*/
function verifyEmail(email) {
// Replace this with your Hunter.io API key
@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:

// 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==
# -*- 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 / nginx.conf
Created February 4, 2016 08:35 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@fizerkhan
fizerkhan / haproxy.cfg
Created October 26, 2015 08:25 — forked from GABeech/haproxy.cfg
Stack Exchange HAProxy
# This is an example of the Stack Exchange Tier 1 HAProxy config
# The only things that have been changed from what we are running are:
# 1. User names have been removed
# 2. All Passwords have been remove
# 3. IPs have been changed to use the example/documentation ranges
# 4. Rate limit numbers have been changed to randome numbers, don't read into them
userlist stats-auth
group admin users $admin_user
user $admin_user insecure-password $some_password
@fizerkhan
fizerkhan / autofocus.js
Last active August 29, 2015 14:26 — forked from mlynch/autofocus.js
AngularJS Autofocus directive
/**
* the HTML5 autofocus property can be finicky when it comes to dynamically loaded
* templates and such with AngularJS. Use this simple directive to
* tame this beast once and for all.
*
* Usage:
* <input type="text" autofocus>
*/
angular.module('utils.autofocus', [])