Skip to content

Instantly share code, notes, and snippets.

View djanix's full-sized avatar

Janic Beauchemin djanix

View GitHub Profile
@djanix
djanix / keybase.md
Created April 25, 2018 21:35
Keybase Proof

Keybase proof

I hereby claim:

  • I am djanix on github.
  • I am janic (https://keybase.io/janic) on keybase.
  • I have a public key ASBugaCCcBV1sLJDhXULIuobCBpew0QB4cFODO6kBkOOeQo

To claim this, I am signing this object:

@djanix
djanix / .bash_profile
Created March 20, 2018 03:34
auto `nvm use`
# 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
@djanix
djanix / ellipsis
Last active September 28, 2015 20:52
multi-line text ellipsis mixin
//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;
}
@djanix
djanix / breakpoints
Last active August 29, 2015 14:22
breakpoints js / css
module.exports = {
init: function () {
var self = this;
self.setDeviceType();
$(window).resize(function () {
self.setDeviceType();
});
@djanix
djanix / git remove commit
Last active August 29, 2015 14:17
git remove commit
- 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)
@djanix
djanix / responsive svg polygon
Created December 8, 2014 22:49
html - responsive svg polygon
<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>
$('#item').waypoint(function(direction) {
if (direction != 'down') { return; }
// do stuff
}, { offset: '50%' });
$('#item').waypoint(function(direction) {
if (direction != 'up') { return; }
// do stuff
}, { offset: '-50%' });
@djanix
djanix / jquery ajax call
Last active August 29, 2015 14:02
jquery ajax call
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;
@djanix
djanix / css -> clearfix
Last active December 30, 2015 00:49
h5bp clearfix
/*
* 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.
@djanix
djanix / css transition fix
Created July 11, 2013 15:27
css fix when using css transition or filter (element is flashing)
.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;
}