Skip to content

Instantly share code, notes, and snippets.

View sajhd's full-sized avatar

Sajhd Hussain sajhd

View GitHub Profile
@sajhd
sajhd / center-ie.scss
Last active November 26, 2020 16:27
When flexbox centering is not picked up in IE
.container {
margin: 0 auto;
left: 0;
right: 0;
width: 100
}
@sajhd
sajhd / seasons.php
Last active December 14, 2017 14:24
Work on season
<?php
//get current month
$currentMonth = DATE("m");
echo $currentMonth;
//retrieve season
if ($currentMonth >= "03" && $currentMonth <="05")
@sajhd
sajhd / twitter-feed.php
Last active December 14, 2017 14:25
Pull in tweet using API
<?php
// Grab the Authentication Library
include locate_template('parts/twitteroauth/autoload.php');
use Abraham\TwitterOAuth\TwitterOAuth;
// Store some secret keys
$connection_key = 'KEY-HERE';
$connection_secret = 'SECRET-HERE';
$access_token = 'TOKEN-HERE';
.padded-multi-lines {
display: inline;
background: blue;
box-shadow: 5px 0 0 blue, -5px 0 0 blue;
}
@sajhd
sajhd / breakpoints.scss
Created December 2, 2015 15:42
Breakpoints
$tablet-width : 480px;
$desktop-width : 800px;
$large-width : 1200px;
$full-width : 1600px;
@mixin device480 {
@media (min-width: #{$tablet-width}) {
@content;
}
}
@sajhd
sajhd / weights.scss
Created December 2, 2015 15:40
Font weights
// Font weights
$light: 300;
$regular: 400;
$semi-bold: 600;
$bold: 700;
@mixin transition($args...) {
-webkit-transition: $args;
-moz-transition: $args;
-ms-transition: $args;
-o-transition: $args;
transition: $args;
}
/*
Usage
@function calculateRem($size) {
$remSize: $size / 16px;
@return $remSize * 1rem;
}
@mixin font-size($size) {
font-size: $size;
font-size: calculateRem($size);
}
@sajhd
sajhd / row-machine.scss
Last active August 29, 2015 14:27
Row Machine Mixin
// Row Machine ///
@mixin rowMachine($numPerRow, $margin) {
width: ((100% - (($numPerRow - 1) * $margin)) / $numPerRow);
&:nth-of-type(n) {
margin-right: $margin;
}
&:nth-of-type(#{$numPerRow}n) {
margin-right: 0;
margin-bottom: $margin;
@sajhd
sajhd / fade-in.scss
Last active January 8, 2020 14:57
Fade In Animation Mixin
/* Fade In Animation */
@keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
/* Firefox < 16 */
@-moz-keyframes fadein {
from { opacity: 0; }