Skip to content

Instantly share code, notes, and snippets.

View nicoespeon's full-sized avatar

Nicolas Carlo nicoespeon

View GitHub Profile
@nicoespeon
nicoespeon / dabblet.css
Created April 11, 2013 04:55
dabblet use example
.block {
text-align: justify;
background-color: #DDD;
border: 2px black solid;
border-radius: 10px;
}
.lightbox {
width: 90px;
@nicoespeon
nicoespeon / compressor.rb
Last active December 16, 2015 04:19 — forked from mytharcher/compressor.rb
A jekyll plugin for compressing HTML, JavaScript files when rendering.
#
# File compressor plugin for jekyll
# =================================
#
# By [mytharcher](https://github.com/mytharcher)
# 2012-05-20
#
# Updated by [nicoespeon](https://github.com/nicoespeon)
# 2013-04-12
#
@nicoespeon
nicoespeon / dabblet.css
Created August 13, 2013 23:01
Untitled
@-keyframes reveal {
0% {
left: 0;
}
100% {
left: 100%;
}
}
.container {
position: relative;
@nicoespeon
nicoespeon / category_pagination.rb
Last active April 27, 2017 20:45
Per category pagination Jekyll 1.5.1
# Per-category pagination. Useful for multilingual blogs =)
# It will react, regarding your configuration in `config.yml`:
#
# paginate_per_category: true|false - activate this pagination or keep the
# default one
# default_category: "en" - determine the default category if you
# wish the root pagination to be this one
module Jekyll
module Generators
class Pagination < Generator
/**
* Tu ne peux pas ne pas avoir d’effets de bord, sinon il ne se passe absolument rien.
*
* En revanche, la prog fonctionnelle préconise de limiter ça au maximum.
*
* Du coup c’est possible de le faire, mais généralement l’effet de bord qui log est isolé à un seul endroit (= une fonction impure).
*
* Il est assez simple de transformer une fonction impure en fonction pure : il suffit de l’englober dans une closure.
**/
function impure$ () {
@nicoespeon
nicoespeon / plopfile.js
Last active March 23, 2016 23:48
Blog - Plop — a micro-generator to ease your daily life - setGenerator
module.exports = ( plop ) => {
// We declare a new generator called "module"
plop.setGenerator( "module", {
// Succintly describes what generator does.
description: "Create a new module",
// Get inputs from the user.
// That's Inquirer.js doing the job behind the hood.
@nicoespeon
nicoespeon / plopfile.js
Last active March 23, 2016 23:48
Blog - Plop — a micro-generator to ease your daily life - prompts
import {trimRight, isEmpty} from "lodash";
const ensurePlural = ( text ) => trimRight( text, "s" ) + "s";
const isNotEmptyFor = ( name ) => {
return ( value ) => {
if ( isEmpty( value ) ) return name + " is required";
return true;
}
}
@nicoespeon
nicoespeon / plopfile.js
Last active March 23, 2016 23:47
Blog - Plop — a micro-generator to ease your daily life - concrete example
const modulePath = "app/modules/{{camelCase name}}.js";
module.exports = ( plop ) => {
plop.setGenerator( "model", {
// …
actions: [
// Add a new model + tests boilerplate.
@nicoespeon
nicoespeon / model.js
Last active March 23, 2016 23:47
Blog - Plop — a micro-generator to ease your daily life - plop-template
/**
* TODO - Describe what your model does.
*
* @class {{pascalCase name}}.Model
* @module {{pascalCase name}}
* @constructor
*/
import {Model} from "backbone";
export default Model.extend( {
@nicoespeon
nicoespeon / calendars.model.js
Last active March 23, 2016 23:47
Blog - Plop — a micro-generator to ease your daily life - calendars.model result
/**
* TODO - Describe what your model does.
*
* @class Calendars.Model
* @module Calendars
* @constructor
*/
import {Model} from "backbone";
export default Model.extend( {