Skip to content

Instantly share code, notes, and snippets.

View fethica's full-sized avatar
:octocat:

Fethi fethica

:octocat:
View GitHub Profile
@fethica
fethica / clickableDIV.js
Created June 19, 2013 23:49
Make Entire Div Clickable
$(".myBox").click(function(){
window.location=$(this).find("a").attr("href");
return false;
});
@fethica
fethica / indentOutput.cpp
Created May 30, 2013 01:58
Indent output to ofstream.
void indentedOutput(ostream &outStream, const char *message, bool &newline)
{
while (char cur = *message) {
if (newline) {
outStream << " ";
newline = false;
}
outStream << cur;
if (cur == '\n') {
newline = true;
@fethica
fethica / bdi.css
Created May 1, 2013 23:10
Simulate the <bdi></bdi> tag in IE and older browsers, to mix english content with right to left languages (arabic) More info: http://www.w3.org/International/questions/qa-bidi-css-markup
.bdi{
direction: rtl;
unicode-bidi: embed;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fethica
fethica / gist:5053305
Created February 28, 2013 00:58
Style a button with Sass
border: 1px solid darken($base-color, 20%);
text-shadow: 0 -1px 0 darken($base-color, 10%);
@include box-shadow(inset 0 1px 0 lighten($base-color, 20%));
@fethica
fethica / JavaScript: Change a class every 2 seconds
Last active December 14, 2015 02:59
A simple jQuery function to change a class every 2 seconds.
function switchClass(){
var delay = 2000;
var colors = new Array ("red", "grey", "green", "blue");
var i = 0;
setInterval(function(){
$('span').removeClass(colors[i]);
i++;
@fethica
fethica / gist:4740230
Last active December 12, 2015 07:58
JavaScript: Detect IE in jQuery
if($.browser.msie){//if it's Microsoft Internet Explorer
alert($.browser.version);//Browser version
}