Skip to content

Instantly share code, notes, and snippets.

View alireza-saberi's full-sized avatar
🎯
Focusing

Alireza Saberi alireza-saberi

🎯
Focusing
  • Couple of big/medium/small un/known companies around the world
  • Michigan, USA
View GitHub Profile
@alireza-saberi
alireza-saberi / loading-tag.html
Created March 10, 2017 13:36
Converted rotating loading sign to based64 to ASCII string
<img data-ng-if="dataLoading" src="data:image/gif;base64,R0lGODlhEAAQAPIAAP///wAAAMLCwkJCQgAAAGJiYoKCgpKSkiH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAADMwi63P4wyklrE2MIOggZnAdOmGYJRbExwroUmcG2LmDEwnHQLVsYOd2mBzkYDAdKa+dIAAAh+QQJCgAAACwAAAAAEAAQAAADNAi63P5OjCEgG4QMu7DmikRxQlFUYDEZIGBMRVsaqHwctXXf7WEYB4Ag1xjihkMZsiUkKhIAIfkECQoAAAAsAAAAABAAEAAAAzYIujIjK8pByJDMlFYvBoVjHA70GU7xSUJhmKtwHPAKzLO9HMaoKwJZ7Rf8AYPDDzKpZBqfvwQAIfkECQoAAAAsAAAAABAAEAAAAzMIumIlK8oyhpHsnFZfhYumCYUhDAQxRIdhHBGqRoKw0R8DYlJd8z0fMDgsGo/IpHI5TAAAIfkECQoAAAAsAAAAABAAEAAAAzIIunInK0rnZBTwGPNMgQwmdsNgXGJUlIWEuR5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQJCgAAACwAAAAAEAAQAAADMwi6IMKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQJCgAAACwAAAAAEAAQAAADMgi63P7wCRHZnFVdmgHu2nFwlWCI3WGc3TSWhUFGxTAUkGCbtgENBMJAEJsxgMLWzpEAACH5BAkKAAAALAAAAAAQABAAAAMyCLrc/jDKSatlQtScKdceCAjDII7HcQ4EMTCpyrCuUBjCYRgHVtqlAiB1YhiCnlsRkAAAOwAAAAAAAAAAAA=="/>
@alireza-saberi
alireza-saberi / day-night-css.html
Created March 7, 2017 01:59
This is a simple hack that, we can tell the browser which CSS it should use during the day and which CSS it should use during the night time.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<script type="text/javascript">
function setTimedStylesheet(){
var theTime = new Date().getHours();
if ( 8 <= theTime && theTime < 20) {
// day time
document.write("<link rel='stylesheet' href='daytime.css'");
@alireza-saberi
alireza-saberi / clearfix.css
Created February 27, 2017 16:32
The clearfix allows a container to wrap it's floated children. Without a clearfix or equivalent styling, a container does not wrap around its floated children and collapses, just as if its floated chldren were positioned absolutely.
.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
/* CSS rule for IE6 */
@alireza-saberi
alireza-saberi / gist:e266197c5246df513200096cee714cb5
Created February 7, 2017 13:43
console.log solution for IE9 (2011) and earlier browsers.
/*
Jan-7th-2017
http://caniuse.com/#feat=console-basic
IE9: Only supports console functions when developer tools are open, otherwise the console object is undefined and any calls will throw errors.
IE 11 mobile, UC browser, Blackberry browsers, Opera 37 for Anroid
Allows console functions to be used without throwing errors, but does not appear to output the data anywhere
*/
// solution 1: Wrapper function
function log(text) {
@alireza-saberi
alireza-saberi / Startup
Last active August 29, 2015 14:07 — forked from bsamadi/Startup
# Iran