Skip to content

Instantly share code, notes, and snippets.

View zastrow's full-sized avatar
🦄
Making the Web a magical place

Philip Zastrow zastrow

🦄
Making the Web a magical place
View GitHub Profile
@zastrow
zastrow / Double Prefix Mixin.scss
Created November 24, 2012 19:22
For vendor prefixes that are required for both the property and the value || e.g. transform or animation
@mixin double-prefix ($prop, $val...) {
-webkit-#{$prop}:-webkit-#{$val};
-moz-#{$prop}: -moz-#{$val};
#{$prop}: #{$val};
}
@zastrow
zastrow / Vendor Prefix Mixin.scss
Created November 24, 2012 19:23
SASS mixing for standard vendor prefixes
@mixin prefix ($prop, $val...){
-webkit-#{$prop}:#{$val};
-moz-#{$prop}:#{$val};
#{$prop}:#{$val};
}
@zastrow
zastrow / CSS Gradients Mixin.scss
Created November 24, 2012 19:25
CSS Gradients - Does not include fall backs || Choose Linear or Radial first
@mixin gradient ($type, $val...) {
background: -webkit-#{$type}-gradient(#{$val});
background: -moz-#{$type}-gradient(#{$val});
background: -ms-#{$type}-gradient(#{$val});
background: -o-#{$type}-gradient(#{$val});
background: #{$type}-gradient(#{$val});
}
@zastrow
zastrow / gist:4144280
Created November 25, 2012 16:44
Simple JavaScript class toggle.
function toggleClass() {
document.getElementById('itemId').classList.toggle('itemClass');
}
@zastrow
zastrow / gist:4264023
Created December 12, 2012 01:20
Script to display window dimension. Updates on resize for getting needed measurements for RWD media queries. Library independent.
// Window Dimensions
window.onload = function() {
makeDiv();
showWin();
};
window.onresize = showWin;
function makeDiv() {
var d = document.createElement('div');
@zastrow
zastrow / gist:4527099
Last active December 11, 2015 01:59
Final Exercise from "Learning to Program" Chapter 9. This program changes inserted numbers to the Roman Numeral equivalent in two different styles.
## Old Roman Style
def old_roman num
m = ( num ) / 1000
d = ( num % 1000 ) / 500
c = ( num % 500 ) / 100
l = ( num % 100 ) / 50
x = ( num % 50 ) / 10
v = ( num % 10 ) / 5
i = ( num % 5 )
puts 'Old Roman Stlye: ' +
@zastrow
zastrow / gist:4528502
Last active December 11, 2015 02:09
Exercise from "Learning to Program" Chapter 7: Leap Year Generator. Insert two different years and the program will calculate all the leap year(s) between them.
while true
puts 'Start Year:'
yearOne = gets.chomp.to_i
puts 'End Year:'
yearTwo = gets.chomp.to_i
if yearOne > yearTwo
startYear = yearTwo
endYear = yearOne
else
@zastrow
zastrow / TeamworkPM Logged Time
Last active December 16, 2015 13:48
TeamworkPM Logged billable hours display for Panic's Status Board. Note you'll need to add in your TeamworkPM API information.
<?php include('tw-api.php'); /* Your TeamworkPM API Info */
/* Set ?userid=YOURID to select the person's time to display or uncomment and redecalre below */
/* $userid = YOURID; */
?>
<html>
<head>
<style>
body { color:#fff; font-family: "Roadgeek 2005 Series C"; font-weight:normal; text-align:center; }
h1 { margin:0; font-size:90px; }
p { margin:40px 0 30px; color:rgb(100, 112, 118); text-transform:uppercase }
window.jumpingBuses = ->
"awesome!"
window.jumpingBuses = ->
"awesome!"