Skip to content

Instantly share code, notes, and snippets.

View jrudenstam's full-sized avatar

Jacob Rudenstam jrudenstam

View GitHub Profile
@jrudenstam
jrudenstam / modulus
Last active August 29, 2015 14:06
Ok, so this is how i remeber how modulus works
function modulus( leftValue, rightValue ) {
var remainder = leftValue;
while ( remainder >= rightValue ) {
remainder-rightValue;
}
return remainder;
}
@jrudenstam
jrudenstam / get-field-recursive.php
Created November 19, 2013 20:11
Will get value from an Advanded Custom Field recursively. Meaning traversing up until value is found.
<?php
/*
* Get ACF fields recursivly
* (if post does not have value look upward until found)
*/
function get_field_recursive( $field, $level_id = null ) {
// If no ID is passed set to post ID
$level_id = $level_id == null ? get_queried_object_id() : $level_id;
@jrudenstam
jrudenstam / dabblet.css
Created May 14, 2012 21:55
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
@media only screen and (max-device-width: 480px){
body{
font-size: 100px;
}
/**
* Bounce
*/
html {height: 97%;}
body {
background-color: hsl(0,50%,50%);
background-image: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.5) 65%, rgba(0,0,0,0.4) 65%, rgba(0,0,0,.1));
height: 100%;
}
@jrudenstam
jrudenstam / dabblet.css
Created April 24, 2012 14:31
Mixed CSS3 demo
/**
* Mixed CSS3 demo
*/
body {
background: hsla(5,20%,70%,1);
font: 16px/22px sans-serif;
text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
}
body{
}
/* Button */
.button {
background-color: hsla(90,40%,50%,1);
border-style: solid;
border-width: 1px;
border-color: rgba(255,255,255,0.7) rgba(0,0,0,0.2) rgba(0,0,0,0.2) rgba(255,255,255,0.4);
@jrudenstam
jrudenstam / dabblet.css
Created April 23, 2012 20:09
Mixed CSS3 demo
/**
* Mixed CSS3 demo
*/
body {
background: hsla(5,20%,70%,1);
font: 16px/22px sans-serif;
text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
}
/**
* CSS demo
*/
@keyframes demo {
0%{
margin-left: 0;
width: 0;
}
@jrudenstam
jrudenstam / dabblet.css
Created April 23, 2012 09:08
Mobile first demo
/**
* Mobile first demo
*/
* {box-sizing: border-box;}
body {
/*background: hsl(60,80%,70%);*/
background-color: hsl(60,30%,70%);
background-image:
@jrudenstam
jrudenstam / dabblet.css
Created April 10, 2012 07:14
Mobile first live demo
/**
* Mobile first live demo
*/
* {box-sizing: border-box;}
body {
/*background: hsl(60,80%,70%);*/
background-color: hsl(60,30%,70%);