This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script class="example" type="text/javascript"> | |
// Create the tooltips only on document load | |
$(document).ready(function() | |
{ | |
// Make sure to only match links to wikipedia with a rel tag | |
$('a[href*=wikipedia.org/][rel]').each(function() | |
{ | |
// We make use of the .each() loop to gain access to each element via the "this" keyword... | |
$(this).qtip( | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Factory.define :user_with_role, :parent => :user do |user| | |
user.after_create { |p| Factory(:role, :users => [p]) } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arr = [1,2,3,4,5,3,4,5,2,3,3,4] | |
arr.inject(Hash.new(0)) { |h, e| h[e] += 1 ; h } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Show images recursively in a directory v1.0 | |
Author: Mathuvathanan Mounasamy | |
Licensed under the MIT license | |
*/ | |
showImages('media/catalog/product/F'); | |
function showImages($directory) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.album-billede-box-pop { | |
width: 100%; | |
text-align: center; | |
} | |
.album-billede-single-pop { | |
display: inline-block; | |
} | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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! | |
// http://www.mjdigital.co.uk/blog | |
// SEARCH FOR | |
$search = '**__FIND_THIS__**'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": "TouchCursor Mode", | |
"rules": [ | |
{ | |
"description": "TouchCursor Mode [Space as Trigger Key]", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "spacebar", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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)); |