Skip to content

Instantly share code, notes, and snippets.

View grim-reapper's full-sized avatar

Imran Ali grim-reapper

View GitHub Profile
@grim-reapper
grim-reapper / copy-element-text-bookmarklet.js
Created October 14, 2019 08:05 — forked from foobear/copy-element-text-bookmarklet.js
JavaScript bookmarklet to click an element and copy its text contents. See https://makandracards.com/makandra/46962
(function() {
var overlay = document.createElement('div');
Object.assign(overlay.style, {
position: 'fixed',
top: 0,
left: 0,
width: '100vw',
height: '100vh',
zIndex: 99999999,
background: 'transparent',
@grim-reapper
grim-reapper / jquery.advanced-plugin.js
Created September 26, 2019 19:06 — forked from cmarkle27/jquery.advanced-plugin.js
Advanced jQuery Plugin
// plug it in, plug it in
(function($) {
var paraCount = function() {
return {
options: {
itemClass: 'awesome',
baseUrl: "/",
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MediaCapture and Streams API</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="main.css">
</head>
<body>
<header>
@grim-reapper
grim-reapper / flash_messages.php
Created August 11, 2019 05:24 — forked from BaylorRae/flash_messages.php
Flash Messages for PHP
<?php
class FlashMessages {
private $messages = array();
private $now = false;
private static $instance = null;
private function __construct() {
// Save all messages
$this->messages = $_SESSION['flash_messages'];
@grim-reapper
grim-reapper / Obfuscator.php
Created August 2, 2019 12:01 — forked from adhocore/Obfuscator.php
Obfuscator - The naive and trivial PHP Code obfuscator | deobfuscator
<?php
/**
* Obfuscator - The naive and trivial PHP Code obfuscator | deobfuscator
*
* generate() Generates a obfuscated string of given code
* also gives the chunk value required by work()
* work() Reverses the obfuscated string using chunk value given by generate()
* to original code and then execute the code and returns response
*
@grim-reapper
grim-reapper / password-regex.txt
Created August 1, 2019 13:04 — forked from shankara-subramani/password-regex.txt
password regex with optional special characters
^(?=.*\d)(?=.*[a-z])[\w~@#$%^&*+=`|{}:;!.?\"()\[\]-]{6,8}$
@grim-reapper
grim-reapper / disableBodyScroll.js
Created July 30, 2019 11:21 — forked from thuijssoon/disableBodyScroll.js
iOS disable body scroll
/**
* Prevent body scroll and overscroll.
* Tested on mac, iOS chrome / Safari, Android Chrome.
*
* Based on: https://benfrain.com/preventing-body-scroll-for-modals-in-ios/
* https://stackoverflow.com/a/41601290
*
* Use in combination with:
* html, body {overflow: hidden;}
*
@grim-reapper
grim-reapper / php-headers.php
Created July 29, 2019 07:02 — forked from reinink/php-headers.php
PHP header examples
<?php
// Source: http://www.jonasjohn.de/snippets/php/headers.htm
// Use this header instruction to fix 404 headers
// produced by url rewriting...
header('HTTP/1.1 200 OK');
// Page was not found:
header('HTTP/1.1 404 Not Found');
@grim-reapper
grim-reapper / Paypal Rest API Codeigniter
Created July 11, 2019 10:33 — forked from RobertoNovelo/Paypal Rest API Codeigniter
CodeIgniter 3.x Paypal Rest API Authorize Capture Wrapper
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once(BASEPATH . '../application/libraries/PayPal-PHP-SDK/autoload.php');
use PayPal\Rest\ApiContext;
use PayPal\Auth\OAuthTokenCredential;
use PayPal\Api\Capture;
use PayPal\Api\Authorization;
use PayPal\Api\Amount;
use PayPal\Exception\PayPalConnectionException;
@grim-reapper
grim-reapper / .htaccess
Created July 11, 2019 07:46 — forked from Darep/.htaccess
PHP CSS&JS auto-versioning function.
# CSS/JS auto-versioning
RewriteEngine On
RewriteRule ^(.*)\.[\d]{10}\.(css|js)$ $1.$2 [L]