This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(function ($) { | |
var normalizePostalCode = function (postalCode) { | |
return postalCode.replace(/[^a-z0-9]/gi, '').toUpperCase(); | |
}; | |
var formatPostalCode = function (postalCode) { | |
var regex = /^([abceghjklmnprstvwxyz][0-9][abceghjklmnprstvwxyz])([0-9][abceghjklmnprstvwxyz][0-9])$/i; | |
var normalized = normalizePostalCode(postalCode); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.container { | |
transform: translateZ(0); | |
-ms-transform: translateZ(0); | |
-webkit-transform: translateZ(0); | |
backface-visibility: hidden; | |
-webkit-backface-visibility: hidden; | |
-moz-backface-visibility: hidden; | |
-ms-backface-visibility: hidden; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Clearfix: contain floats | |
* | |
* For modern browsers | |
* 1. The space content is one way to avoid an Opera bug when the | |
* `contenteditable` attribute is included anywhere else in the document. | |
* Otherwise it causes space to appear at the top and bottom of elements | |
* that receive the `clearfix` class. | |
* 2. The use of `table` rather than `block` is only necessary if using | |
* `:before` to contain the top-margins of child elements. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function loadItems(url, params, callback) { | |
$.ajax({ | |
url: url, | |
dataType: 'json', | |
contentType: 'application/json', | |
data: JSON.stringify(params), | |
type: 'POST' | |
}) | |
.done(function (data, textStatus, jqXHR) { | |
var result = ((typeof data) == "string") ? $.parseJSON(data) : data; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" | |
viewBox="0 0 1000 20" preserveAspectRatio="none" width="100%" height="20"> | |
<polygon points="0,0 1000,0 500,20" style="fill:#cc3333; stroke: lightgrey; stroke-width: 6;"/> | |
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- git rebase -i HEAD~3 (pour voir les 3 derniers commits par exemple) | |
effacer les lignes qu'on ne veut pas (sauf une) | |
ctrl-c + :wq (control-c sert a quitter le insert mode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
init: function () { | |
var self = this; | |
self.setDeviceType(); | |
$(window).resize(function () { | |
self.setDeviceType(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//usage: @include ellipsis(3); | |
@mixin ellipsis($lineNumber, $lineHeight: 1.4em) { | |
display: -webkit-box; | |
line-height: $lineHeight; | |
max-height: $lineNumber * $lineHeight; | |
overflow: hidden; | |
-webkit-line-clamp: $lineNumber; | |
-webkit-box-orient: vertical; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NVM version shortcut | |
# change title name of tab in terminal | |
function title { | |
echo -ne "\033]0;"$*"\007" | |
} | |
cd() { | |
builtin cd "$@" || return | |
#echo $PREV_PWD | |
if [ "$PWD" != "$PREV_PWD" ]; then |