Skip to content

Instantly share code, notes, and snippets.

View flexbox's full-sized avatar

David Leuliette flexbox

View GitHub Profile
@flexbox
flexbox / seo_multilang.html
Last active December 17, 2015 22:49
multilang SEO friendly in ruby on rails
<% hreflang = locale == :fr ? 'en' : 'fr' %>
<link href="<%= "http://#{request.host}:#{request.port}#{request.fullpath}" %>" hreflang="<%= hreflang %>" rel="alternate" />
mymodule {
@at-root {
.#{&}-header { ... }
.#{&}-footer { ... }
.#{&}-body {
a { ... }
span { ... }
p { ... }
}
}
@flexbox
flexbox / reset-button--ios.css
Created May 21, 2013 15:05
A little hack to reset default style for iOs button
.button {
-webkit-border-radius: 0px;
-webkit-appearance: button;
-webkit-font-smoothing: antialiased;
}
@flexbox
flexbox / typography.sass
Created May 18, 2013 22:46
typography-heading-mixin
@mixin headings($from: 1, $to: 6){
@if $from >= 1 and $to <= 6{
$heading-selector: (unquote(""));
@for $i from $from through $to {
$heading-selector: $heading-selector, unquote("h#{$i}")
}
#{$heading-selector}{
@content
}
}
@flexbox
flexbox / background-zoom.css
Last active December 16, 2015 22:39
[css] - transition : background zoom image
.bg-zoom {
background-position: center center;
background-size: 100% auto;
transition: background-size 0.5s ease 0s;
}
.bg-zoom:hover {
background-size: 150% auto;
}
@flexbox
flexbox / easterMediaQuery.css
Created March 29, 2013 13:00
A little Easter egg for responsive website
@media only screen and (min-width: 960px) and (max-width: 970px) {
body {
-webkit-transform : rotate(180deg);
-moz-transform : rotate(180deg);
-o-transform : rotate(180deg);
transform : rotate(180deg); }
}
// Straightforward + simple.
$("button").on("click", function(event) {
event.preventDefault();
var button = $(this);
var numberElem = button.find(".number");
var number = Number(numberElem.text()) - 1;
numberElem.text(number);
if (number === 0) {
button.prop("disabled", true);
button.off("click");
<table>
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Email</th>
<th scope="col">Dept, Title</th>
<th scope="col">Phone</th>
</tr>
</thead>
<tbody>
@flexbox
flexbox / markdown-shortcut
Last active December 27, 2016 14:04
Here is all the markup for markdown text files
Title
# h1
## h2
### h3
#### h4
##### h5
###### h6
@flexbox
flexbox / imgScale.css
Last active December 11, 2015 20:18
zoom img using CSS3 transition & transform
.map {
display: block;
overflow: hidden;
}
.map span{
display: block;
height: 250px;
background:url(../img/map.jpg) no-repeat top left;
transition: transform 0.2s linear 0s;