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 / Startup
Last active August 29, 2015 14:07 — forked from bsamadi/Startup
# Iran
@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 / 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 / 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 / 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 / animation.html
Created April 5, 2017 15:29
making a simple animation with js
<!doctype html>
<html>
<head>
<style>
#container {
width: 200px;
height: 200px;
background: green;
position: relative;
}
@alireza-saberi
alireza-saberi / big-mistake-facebook.js
Created May 16, 2017 19:06
facebook dirty STOP! message
var bigMistakeStyle = 'color: red; font-size: 60px font-weight: bold; font-family: helvetica, text-shadow: 1px 1px 2px black;'
console.log('%c STOP!', bigMistakeStyle);
@alireza-saberi
alireza-saberi / responsive_background_image.csss
Created August 8, 2017 15:58
this is css rules to have a responsive background image
background-image: url('') ;
background-position: center center;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
background-color: #999;
@alireza-saberi
alireza-saberi / growing_underline.css
Created August 18, 2017 02:54
a line from left to right grow under a navbar
&:after {
display:block;
content: '';
border-bottom: solid 3px #ffcd00;
transform: scaleX(0);
transition: transform 250ms ease-in-out;
transform-origin:0 50%;
box-sizing: border-box;
}
@alireza-saberi
alireza-saberi / new_checkbox.css
Created August 19, 2017 13:52
Changing the check box
input[type="checkbox"] {
display:none;
}
input[type="checkbox"] + label span {
display:inline-block;
width:19px;
height:19px;
margin:-2px 10px 0 0;
vertical-align:middle;
background:url(check_radio_sheet.png) left top no-repeat;