Skip to content

Instantly share code, notes, and snippets.

View htmelvis's full-sized avatar
🕸️

Ed Wieczorek htmelvis

🕸️
View GitHub Profile
@htmelvis
htmelvis / materialshadows.scss
Created September 30, 2015 12:32
Sass Functions and Mixins for Material Design Style Shadows
@mixin card($depth) {
@if $depth < 1 {
box-shadow: none;
} @else if $depth > 5 {
@warn "Invalid $depth `#{$depth}` for mixin `card`.";
} @else {
box-shadow: bottom-shadow($depth), top-shadow($depth);
}
}
/// Computes a top-shadow for a card effect.
@htmelvis
htmelvis / gist:309ed2fcdf23d087f846
Created July 5, 2015 13:03
Simple ROT13 Cypher for JS
var Decipher = function(text, rot){
var lookup = ["a","b","c","d","e","f","g","h","i","j",
"k", "l", "m", "n", "o", "p", "q", "r",
"s", "t", "u", "v", "w", "x", "y", "z"];
//clone the original lookup table to make a new one
var newLookup = lookup.slice(0);
//This is the offset to go off of
var offset = rot;
//split the message into characters to check against table but lowercase all chars first
@htmelvis
htmelvis / Foxy Shipping International
Last active August 29, 2015 14:22
Shipping snippet for FoxyCart 2.0 International Shipping calculation. Currently not complete just has the conditional for GB and US. Twig templating language with JavaScript.
{% if context == 'cart' or context == 'checkout' %}
<script type="text/javascript" charset="utf-8">
(function (FC, $) {
FC.customFlatRates = {};
FC.customFlatRates.shipping_results = [];
FC.customFlatRates.config = {
'autoSelect': false /* Set to true if you'd like the top shipping option to be automatically selected for the user */
};