Skip to content

Instantly share code, notes, and snippets.

View RaeesBhatti's full-sized avatar

Raees Iqbal RaeesBhatti

View GitHub Profile
HISTCONTROL=ignoreboth
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\[\033[033;1m\]\W\[\e[0;37m\]\$(parse_git_branch) \[\e[0m\]\$ "
export EDITOR="nano"
export CLICOLOR=1
class Hhvm < Formula
desc "JIT compiler and runtime for the PHP and Hack languages"
homepage "http://hhvm.com/"
url "http://dl.hhvm.com/source/hhvm-3.14.5.tar.bz2"
sha256 "1a5f1960769ac70810d5a578d4d9c9e592048216e5721aa612faf9cca72a7023"
head "https://github.com/facebook/hhvm.git"
option "with-debug", <<-EOS.undent
Make an unoptimized build with assertions enabled. This will run PHP and
@RaeesBhatti
RaeesBhatti / nginx_neverbleed.diff
Created July 7, 2016 03:20 — forked from noname77/nginx_neverbleed.diff
PATCH: nginx v1.11.1 supports neverbleed
diff -ur nginx-1.11.1/auto/modules neverbleed_nginx_patch/nginx-1.11.1/auto/modules
--- nginx-1.11.1/auto/modules 2016-05-31 14:43:50.000000000 +0100
+++ neverbleed_nginx_patch/nginx-1.11.1/auto/modules 2016-06-24 12:10:27.000000000 +0100
@@ -1119,8 +1119,10 @@
ngx_module_type=CORE
ngx_module_name=ngx_openssl_module
ngx_module_incs=
- ngx_module_deps=src/event/ngx_event_openssl.h
- ngx_module_srcs="src/event/ngx_event_openssl.c
+ ngx_module_deps="src/event/ngx_event_openssl.h \
<?php
/**
* This file can be used to generate HHVM/Hack HHI definitions.
* It requires a specific extension to be passed as an argument on the command line.
* It will then loop through all constants, functions, and classes and print accordingly.
*
* For example, to generate HHI definitions for the SPL extension.
*
* php generate.php spl
*
@RaeesBhatti
RaeesBhatti / main.php
Created June 5, 2016 11:35
PHP entrypoint for HackLang app
<?php
// Loader file of your app
require(__DIR__.'/core/app-load.php');
// App class is in HackLang and takes ImmMap $Get, ImmMap $Post, ImmMap $Server, ImmMap $Cookie as parameter
new App(new HH\ImmMap($_GET), new HH\ImmMap($_POST), new HH\ImmMap($_SERVER), new HH\ImmMap($_COOKIE));
@RaeesBhatti
RaeesBhatti / cloudflare_only.sh
Created August 1, 2015 22:43
Allow HTTP and HTTPS from CloudFlare only (Ubuntu)
#!/bin/bash
for i in `curl https://www.cloudflare.com/ips-v4`; do ufw allow from $i to any port 80; done
for i in `curl https://www.cloudflare.com/ips-v6`; do ufw allow from $i to any port 80; done
## If you have setup Full or Strict SSL settings with CloudFlare, use this one also
for i in `curl https://www.cloudflare.com/ips-v4`; do ufw allow from $i to any port 443; done
for i in `curl https://www.cloudflare.com/ips-v6`; do ufw allow from $i to any port 433; done