Skip to content

Instantly share code, notes, and snippets.

View flexbox's full-sized avatar

David Leuliette flexbox

View GitHub Profile
<-- 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 {
<html>
...
<script id="js-module-lazy">
/*
JavaScript commented code
*/
</script>
<script>
function lazyLoad(){
@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
@flexbox
flexbox / comment.markdown
Created June 5, 2014 09:14
open source algorithm gardener
@flexbox
flexbox / magellan-hide.css
Last active August 29, 2015 14:05
Show / hide magellan expedition in page. See the demo http://tallwave.com/
.is-hidden {
display:none;
}
@flexbox
flexbox / datas.yml
Last active August 29, 2015 14:08
data each for yml file matrix
main:
- label: Femme
css_class: m-menu--item-main
submenu:
- entry: Modèle
categories:
- data: "Ballerines et babies"
- data: "Mules & sabots"
- data: "Sandales et nu-pieds"
- data: "Chaussons"
@flexbox
flexbox / inline-validation.js
Created October 8, 2015 12:22
le wagon lille
// Your validation code will go in there.
// Write your validation functions, and bind events
// in a jQuery DOM ready callback
var EVENTS = 'focusout keyup change';
var ZIP_CODE_PATTERN = /^\d{5}$/;
var MOBILE_PHONE_PATTERN = /^(0|\+33)[1-9]\d{8}$/;
var EMAIL_PATTERN =/^([^\.@]+)(\.([^@]+))?@([^@]+)\.([^@]+)$/;
@flexbox
flexbox / flexbox.md
Last active May 10, 2016 12:07
A guide to CSS flexbox box model

1. Container

display: flex;

2. Play with grow / shrink / basis on items

flex: 1 1 0;

flex-grow: 1;

flex-shrink: 1;

@flexbox
flexbox / How to fork your own repository
Created October 12, 2016 13:34
How to fork your own repository
A git fork is really just a git clone plus a change of ownership. What this does is a git clone plus a change of name, maintaining an upstream link to the source repo so you can integrate changes.
Here's a recipe for duplicating a repo:
git clone username/old_repo new_repo
cd new_repo
git remote rename origin upstream
git create username/new_repo
git push -u origin master
@flexbox
flexbox / read-my-PR.md
Last active March 20, 2019 23:18
Find a great pull request naming is hard. Hack your co-workers brain with theses messages

🇺🇸

  1. I turned a bug into a feature. And you will never forget how.
  2. No one had ever coded a function like that. No one.
  3. Never a small omission like that caused so much damage.
  4. The most silly bug in the world has been corrected — the smartest intelligent way.
  5. Do you love coding? That's probably why.
  6. Want to learn a new feature? here's how.
  7. This feature suddenly stopped working. What happened after is incredible
  8. It is possible to reduce a 50 lines function to 3 lines. here's how.