Skip to content

Instantly share code, notes, and snippets.

View freshyill's full-sized avatar
💭
😎 Cool

Chris Coleman freshyill

💭
😎 Cool
View GitHub Profile
@freshyill
freshyill / mediaquery.js
Created November 29, 2012 23:01
Media Queries in jQuery
// Media queries in jQuery
var delay = (function(){
var timer = 0;
return function(callback, ms){
clearTimeout (timer);
timer = setTimeout(callback, ms);
};
})();
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the branch/status of the current git repository
# * the branch of the current subversion repository
# * the return value of the previous command
#
# USAGE:
@freshyill
freshyill / jQuery 2.0 --> 1.9 fallback for IE.html
Last active December 17, 2015 03:39
So it looks like people are confused about how to fallback from jQuery 2 to 1.9 for IE. Is there any reason why this wouldn't work?
<!--[if lte IE 8]>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/jquery-1.9.1.min.js"><\/script>')</script>
<![endif]-->
<!--[if gt IE 8]><!-->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/jquery-2.0.0.min.js"><\/script>')</script>
<!--<![endif]-->
$(function(){
var list = $("ul li").toArray();
var elemlength = list.length;
var randomnum = Math.floor(Math.random()*elemlength);
var randomitem = list[randomnum];
$(randomitem).css("display", "block");
});
@freshyill
freshyill / omega-reset.scss
Created June 17, 2013 19:26
Bourbon Neat Omega Reset
// From https://github.com/joshfry/point-guard
@mixin omega-reset($nth) {
&:nth-child(#{$nth}) { margin-right: flex-gutter(); }
&:nth-child(#{$nth}+1) { clear: none }
}
@freshyill
freshyill / monitor.sh
Last active August 29, 2015 13:58 — forked from mheadd/monitor.sh
#!/usr/bin/env bash
#
# Check if MySQL is running and start it if it's not
UP=$(pgrep mysql | wc -l);
if [ "$UP" -ne 1 ];
then
echo "MySQL is down.";
mysql.server start
@freshyill
freshyill / SassMeister-input-HTML.html
Created April 23, 2014 20:43
Generated by SassMeister.com.
<div class="outer-container">
<div class="row">
<div class="col16">16</div>
</div>
<div class="row">
<div class="col4">4</div>
<div class="col4">4</div>
<div class="col4">4</div>
<div class="col4">4</div>
</div>
@freshyill
freshyill / Atom block comment.less
Created May 6, 2014 19:12
Gives Atom comments a background that extends across the editor
.comment {
background: #666;
color: #222;
&:after {
position: absolute;
background: inherit;
content: " ";
width: 100%;
}
}
@freshyill
freshyill / SassMeister-input-HTML.html
Created May 9, 2014 20:57
Generated by SassMeister.com.
<div class="outer-container">
<div class="row">
<div class="col16">16</div>
</div>
<div class="row">
<div class="col4">4</div>
<div class="col4">4</div>
<div class="col4">4</div>
<div class="col4">4</div>
</div>
@freshyill
freshyill / SassMeister-input.scss
Created May 9, 2014 21:05
Generated by SassMeister.com.
// ----
// Sass (v3.3.7)
// Compass (v1.0.0.alpha.18)
// ----
$ands: (
de: "und",
en: "and",
es: "y",
fr: "et",