Skip to content

Instantly share code, notes, and snippets.

View flexbox's full-sized avatar

David Leuliette flexbox

View GitHub Profile
@flexbox
flexbox / terminal.shell
Created June 3, 2014 09:20
Get out the hell with brew
brew version wtf-formula
cd /usr/local/Library/Formula
git checkout sha-of-da-commit
brew install wtf-formula
<html>
...
<script id="js-module-lazy">
/*
JavaScript commented code
*/
</script>
<script>
function lazyLoad(){
<-- Script tag that will hold jQuery -->
<script id="js-jquery"></script>
<-- Determine if jQuery should be loaded from localStorage or the server -->
<script>
var jqFile;
if ('jqFile' in window.localStorage) {
// 1. The script is already stored
jqFile = window.localStorage.getItem('jqFile');
} else {
@flexbox
flexbox / header-background.css
Last active August 29, 2015 13:57
[css] - header backgound animate
.header-image {
animation: 35s linear 0s normal none infinite movebg;
background: url("/playground/uploads/upload/upload/289/bkgd3.jpg") repeat scroll 0 0 rgba(0, 0, 0, 0);
margin-top: -80px;
padding-bottom: 7em;
padding-top: 160px;
}
@-moz-keyframes movebg {
0% {

Contract Killer

Le contrat open-source à destination des designers et développeurs Web par Stuff & Nonsense


@flexbox
flexbox / gmaps-poi.coffee
Created February 5, 2014 13:57
[coffeescript] - Remove useless POI in google maps
window.onload = ->
styles = [
featureType: "poi"
stylers: [visibility: "off"]
]
styledMap = new google.maps.StyledMapType(styles,
name: "Styled Map"
)
mapOptions =
zoom: 11
@flexbox
flexbox / _pictos.scss
Last active December 25, 2015 20:49
[sass] - Build fast & automated sprite for retina display
//first we'll define the folders where the sprites are and their layouts
$pictos: sprite-map("sprite/pictos/*.png", $layout: smart);
$pictos-2x: sprite-map("sprite/pictos2x/*.png", $layout: smart);
.picto-share_facebook {
@include use-sprite("share_facebook", $pictos, $pictos-2x);
}
.picto-share_google {
@include use-sprite("share_google", $pictos, $pictos-2x);
@flexbox
flexbox / interchange_helper.rb
Last active December 29, 2016 21:20
[ruby on rails] - Image helper for retina display with foundation interchange
module ApplicationHelper
def retina_image_tag(default_name, options={})
retina_name = default_name.gsub(%r{\.\w+$}, '@2x\0')
retina_image_tag(default_name, options.merge('data-interchange' => "[#{asset_path(retina_name)}, (retina)]"))
end
end
@flexbox
flexbox / animate_showlabel.css
Created August 14, 2013 09:37
A nice animate transition for corner label on images
a.shop-picture span {
position: absolute;
display: block;
background-position: 196px 0px;
background-repeat: no-repeat;
width: 282px;
height: 192px;
margin: -186px 0 0 -6px;
animation: showlabel 1s;
-moz-animation: showlabel 1s;
@flexbox
flexbox / autofocus.slim
Last active July 16, 2018 13:22
ruby on rails - simple_form syntax helper
= f.input :name, input_html: { autofocus: f.object.name.blank? }