Skip to content

Instantly share code, notes, and snippets.

Mathuvathanan Mounasamy cowboymathu

Block or report user

Report or block cowboymathu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
cowboymathu / 1-add-middleware.php
Created Feb 15, 2018 — forked from adamwathan/1-add-macros.php
Multiformat Endpoints in Laravel
View 1-add-middleware.php
namespace App\Http\Middleware;
class CaptureRequestExtension
public function handle($request, $next)
if ($request->route()->parameter('_extension') !== null) {
$request->attributes->set('_extension', substr($request->route()->parameter('_extension'), 1));
cowboymathu / touchcursor_mode.json
Created Sep 8, 2017
TouchCursor Karabiner-Elements json
View touchcursor_mode.json
"title": "TouchCursor Mode",
"rules": [
"description": "TouchCursor Mode [Space as Trigger Key]",
"manipulators": [
"type": "basic",
"from": {
"key_code": "spacebar",
View search_and_replace_database.php
// Find and replace facility for complete MySQL database
// Written by Mark Jackson @ MJDIGITAL
// Can be used by anyone - but give me a nod if you do!
$search = '**__FIND_THIS__**';
View preventSpam.js
function escapeAll(str) {
var hexString = "";
for (var index=0; index<str.length; index++) {
var charCode = str.charCodeAt(index);
var h = charCode.toString(16).toUpperCase();
if (h.length == 1) {
h = "0" + h;
h = "%" + h;
hexString += h;
cowboymathu / center-css
Created Apr 21, 2015
magnific-popup center css
View center-css
.album-billede-box-pop {
width: 100%;
text-align: center;
.album-billede-single-pop {
display: inline-block;
cowboymathu / showImages.php
Created Sep 10, 2014
Show images in directory recursively
View showImages.php
Show images recursively in a directory v1.0
Author: Mathuvathanan Mounasamy
Licensed under the MIT license
function showImages($directory) {
cowboymathu / correctImageOrientation.php
Last active Mar 26, 2019
Rotate archived images to correct orientation
View correctImageOrientation.php
Correct image orientation v1.0
Author: Mathuvathanan Mounasamy
Licensed under the MIT license
This funtion correct all the images' orientation in a given path or directory.
cowboymathu / count_array.rb
Created Oct 25, 2011
Count array elements
View count_array.rb
arr = [1,2,3,4,5,3,4,5,2,3,3,4]
arr.inject( { |h, e| h[e] += 1 ; h }
View user_role_association.rb
Factory.define :user_with_role, :parent => :user do |user|
user.after_create { |p| Factory(:role, :users => [p]) }
cowboymathu / qtip-ajax-demo.js
Created Oct 12, 2011
qTip Ajax demo sample
View qtip-ajax-demo.js
<script class="example" type="text/javascript">
// Create the tooltips only on document load
// Make sure to only match links to wikipedia with a rel tag
// We make use of the .each() loop to gain access to each element via the "this" keyword...
You can’t perform that action at this time.