Skip to content

Instantly share code, notes, and snippets.

View MathRivest's full-sized avatar

Mathieu Rivest MathRivest

  • Turo
  • Montreal, QC, Canada
  • 08:50 (UTC -04:00)
  • X @MathRivest
View GitHub Profile
@MathRivest
MathRivest / susy-grid.scss
Last active December 14, 2015 22:49
Susy grid markup
/* =======================================================================
Grid System
========================================================================== */
.grid-container{
@include container;
}
@for $i from 1 through 12 {
.grid-col-#{$i} { @include span-columns($i); }
@MathRivest
MathRivest / custom-checkboxes.scss
Last active November 1, 2019 08:25
Custom SCSS radio/checkbox. No javascript. IE9+ TODO: Disabled states, Hover, focus etc, Fallback to real input for <IE9
/*
* Hide only visually, but have it available for screenreaders: h5bp.com/v
*/
.visuallyhidden {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
@MathRivest
MathRivest / fullscreen-animation.scss
Created September 6, 2013 01:05
Fullscreen background image scale animation
.fullscreenBgContainer{
z-index: 1;
position: absolute;
bottom: 0;
left: 0;
right: 0;
top: 0;
background: {
repeat: no-repeat;
position: center center;
@MathRivest
MathRivest / index.html
Last active August 29, 2015 13:57
Remember cookies state
<ul class="m-items">
<li>
<input type="checkbox"/>
</li>
<li>
<input type="checkbox"/>
</li>
<li>
<input type="checkbox"/>
</li>
@MathRivest
MathRivest / vertical_align.scss
Created April 4, 2014 01:38
Vertical align in sass ie9+
@mixin vertical-align {
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
.element p {
@include vertical-align;
@MathRivest
MathRivest / gitlab.rb
Last active August 29, 2015 14:01
Dashing - Gitlab Latest Commits
GITLAB_BASE_URL = ""
GITLAB_TOKEN = ""
# Retrieve the repositories and commits in gitlab
SCHEDULER.every '5m', :first_in => 0 do |job|
uri = URI("#{GITLAB_BASE_URL}projects?private_token=#{GITLAB_TOKEN}")
response = Net::HTTP.get(uri)
data = JSON.parse(response)
@MathRivest
MathRivest / svg_fallback.js
Created June 17, 2014 13:24
SVG fallback to javascript using modernizr.js
if(Modernizr){
if (!Modernizr.svg || !Modernizr.backgroundsize) {
Y.all("img[src$='.svg']").each(function(node) {
node.setAttribute("src", node.getAttribute('src').toString().match(/.*\/(.+?)\./)[0]+'png');
});
}
}
@MathRivest
MathRivest / favicons.html
Created June 21, 2014 23:22
All Favicons
<!-- non-retina iPhone pre iOS 7 -->
<link rel="apple-touch-icon" href="icon57.png" sizes="57x57">
<!-- non-retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="icon72.png" sizes="72x72">
<!-- non-retina iPad iOS 7 -->
<link rel="apple-touch-icon" href="icon76.png" sizes="76x76">
<!-- retina iPhone pre iOS 7 -->
<link rel="apple-touch-icon" href="icon114.png" sizes="114x114">
<!-- retina iPhone iOS 7 -->
<link rel="apple-touch-icon" href="icon120.png" sizes="120x120">
@MathRivest
MathRivest / mobile_menu.html
Last active August 29, 2015 14:03
Shell to start a collapsible menu on touch devices. Demo: http://codepen.io/anon/pen/KmkGb
<div class="page">
<div class="nav-mobile-pusher">
<!-- Nav goes here -->
<nav id="nav-mobile" class="nav-mobile">Mobile menu</nav>
<!-- Content goes here -->
<div class="container">
<a href="/" id="nav-mobile-toggle" class="nav-mobile-toggle">Open/Close</a>
<br>
My content
</div>
@MathRivest
MathRivest / middleman.sh
Created July 25, 2014 17:21
Basic vagrant file for middleman
echo "--- Update OS package list ---"
sudo apt-get update
echo "--- Update Timezone ---"
sudo cp /usr/share/zoneinfo/America/Montreal /etc/localtime
echo "--- Installing Git-core ---"
sudo apt-get install -y git-core
echo "--- Updating default ruby ---"