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
<!doctype html> | |
<html> | |
<head></head> | |
<body> | |
<div class="tooltip"> | |
<div class="tikon"></div> | |
<div class="tiptext">This is the longest ever tooltip you might have seen in whole world wide web.</div> | |
</div> | |
</body> | |
</html> |
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 | |
/** | |
* Converts the integer to binary and outputs list of integers that are power of 2 | |
* | |
* @author: Jabran Rafique <[email protected]> | |
* @param: integer $decimal | |
* @return: string | |
*/ | |
function get_special_binary( $decimal ) { |
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
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON("package.json"), | |
coffee: { | |
options: { | |
bare: true | |
}, | |
glob_to_multiple: { | |
expand: true, | |
flatten: true, |
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
// Enable IE8 support for indexOf | |
if ( typeof Array.prototype.indexOf === 'undefined' ) { | |
Array.prototype.indexOf = function(item) { | |
for (var i = 0; i < this.length; i++) { | |
if (this[i] === item) { | |
return i; | |
} | |
return -1; | |
} | |
} |
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
// Check and verify user status or prompt for authorization | |
function checkUserStatus(response) { | |
var permissions = { | |
scope: '' // email | |
}; | |
if ( isConnectedUser(response) ) | |
return FB.api('/me', gotUserInfo); | |
return FB.login(checkUserStatus, permissions); | |
} |
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
// setup | |
!(function(root) { | |
var AsyncGoogleMap = (function() { | |
// constructor | |
function AsyncGoogleMap(canvas, lat, lng, zoom, callback) { | |
if ( typeof canvas === 'undefined' ) |
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
/** | |
* This is small, light weight vanilla JavaScript Bootstrap script. | |
* | |
* It comes handy in situations where a framework i.e. jQuery is used only | |
* for "load" and "ready" events etc. This small script will not only save | |
* lot of bytes but also gives a basic start on writing object literal JavaScript. | |
* | |
* Learn more about object literal JavaScript at following resource: | |
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Values,_variables,_and_literals | |
* |
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
<!-- | |
This is code for working example of vanilla JavaScript Bootstrap | |
script at: https://gist.github.com/jabranr/254f6b47dd765ac50654 | |
Copy this all code and save as an HTML file to see the demo. | |
--> | |
<!doctype HTML> |
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
/** | |
* Originally wrote this snippet for Suffragette/Pathé campaign (https://apps.facebook.com/inspiring-women) | |
* | |
* The campaign app forms a grid of square images pulled from social APIs based on | |
* particular hashtags. This snippet sets the new width and | |
* height based on their natural width and height to maintain the aspect ratio. | |
* Works best for 1:1 aspect ratio but can be modified to accommodate other ratio. | |
* | |
* @param Element|Resource img - An image element/resource from DOM | |
* @param int expected - Expected width or height |
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
{ | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
"draw_centered": false, | |
"fade_fold_buttons": false, | |
"file_exclude_patterns": | |
[ | |
"*.pyc", | |
"*.pyo", | |
"*.exe", |
OlderNewer