Skip to content

Instantly share code, notes, and snippets.

View rahilwazir's full-sized avatar
🎯
Focusing (kinda)

Rahil Wazir rahilwazir

🎯
Focusing (kinda)
View GitHub Profile
<?php
# RegEx For Eval Removal: \s+(eval\(base64.*?\))\);
exit;
function back_to_for_slash($str) {
return str_replace('\\', '/', $str);
}
$current_dir = back_to_for_slash(dirname(__FILE__) . '/public_html');
$directory = $current_dir;
@rahilwazir
rahilwazir / csv
Created May 27, 2014 12:53
Convert array to csv
function download_send_headers($filename) {
// disable caching
$now = gmdate("D, d M Y H:i:s");
header("Expires: Tue, 03 Jul 2001 06:00:00 GMT");
header("Cache-Control: max-age=0, no-cache, must-revalidate, proxy-revalidate");
header("Last-Modified: {$now} GMT");
// force download
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
@rahilwazir
rahilwazir / autoloader
Created May 27, 2014 16:27
Autoloader PHP Classes with Namespace
namespace SearchBlox;
function spl_autoloader($class)
{
$file = RW_DIR . 'classes/' . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php';
if (file_exists($file)) {
include_once $file;
}
}
@rahilwazir
rahilwazir / so_review
Created June 6, 2014 10:19
StackOverflow - Reviews
// ==UserScript==
// @name StackOverflow - Reviews
// @description Automatic enters to review section
// @match http://stackoverflow.com/review*
// @copyright 2014+, Rw
// @grant yes
// ==/UserScript==
var Reviews = (function() {
@rahilwazir
rahilwazir / so_code_fonts
Last active August 29, 2015 14:02
StackOverflow - Change font family of markdown
// ==UserScript==
// @name StackOverflow - Change font family of markdown
// @namespace http://use.i.E.your.homepage/
// @version 0.1
// @description enter something useful
// @match http://stackoverflow.com/*
// @copyright 2012+, You
// @grant none
// ==/UserScript==
@rahilwazir
rahilwazir / detect_bootstrap
Last active August 29, 2015 14:02
Detect existing Bootstrap (CSS)
$('link').each(function (index, element){
var bootExist = /bootstrap\.(?:min\.)?css/.test($(element).prop('href'));
if (bootExist) {
$(element).remove();
return false;
}
});
{
"color_scheme": "Packages/Theme - Flatland/Flatland Dark.tmTheme",
"font_face": "Monospace",
"font_size": 12,
"ignored_packages":
[
"Vintage"
],
"shift_tab_unindent": true,
"soda_classic_tabs": true,
[
{
"name": "Afghanistan",
"code": "AF"
},
{
"name": "Åland Islands",
"code": "AX"
},
{
<?php
/**
* Usage:
* $message = 'My First Push Notification!';
* $pushServer = new PushSerer();
* $pushServer->pushToGoogle('REG-ID-HERE', $message);
* $pushServer->pushToApple('DEVICE-TOKEN-HERE', $message);
*/
class PushServer
<?php
/**
* Usage:
* $message = 'My First Push Notification!';
* $pushServer = new PushSerer();
* $pushServer->pushToGoogle('REG-ID-HERE', $message);
* $pushServer->pushToApple('DEVICE-TOKEN-HERE', $message);
*/
class PushServer