Skip to content

Instantly share code, notes, and snippets.

View jumichot's full-sized avatar
🏠
Working from home

julien michot jumichot

🏠
Working from home
View GitHub Profile
@bejes
bejes / spancount.js
Created October 19, 2012 02:29
Simple jquery plugin to insert spans in text and a defined character limit
/**
* Plugin function to insert spans into text:
* usage
* $(document).ready(function() {
* $('p.charcount').charSpanCount(); });
* or $(document).ready(function() {
* $('p.charcount').charSpanCount({'charcount' : 15});
* });
*/
(function($) {
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active June 2, 2024 11:23
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@Flink
Flink / gist:bb6cbf28871b9541ba6c
Last active July 17, 2018 18:57
Ruby DCI articles & related
http://rubyrogues.com/056-rr-david-heinemeier-hansson/
http://mikepackdev.com/blog_posts/24-the-right-way-to-code-dci-in-ruby
http://mikepackdev.com/blog_posts/37-dci-the-king-of-the-open-closed-principle
http://decomplecting.org/blog/2013/01/03/dci-the-right-idea-for-the-wrong-paradigm/
http://evan.tiggerpalace.com/articles/2011/11/24/dci-that-respects-the-method-cache/
http://tonyarcieri.com/dci-in-ruby-is-completely-broken
https://signalvnoise.com/posts/3372-put-chubby-models-on-a-diet-with-concerns
http://blog.codeclimate.com/blog/2012/12/19/dci-concerns-and-readable-code/
http://blog.codeclimate.com/blog/2012/10/17/7-ways-to-decompose-fat-activerecord-models/
http://martinfowler.com/bliki/AnemicDomainModel.html

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@voter101
voter101 / Gulpfile.js
Last active November 29, 2021 01:17
Gulpfile for Rails application with replaced Sprockets with Gulp
'use strict'
var gulp, sass, babelify, browserify, watchify, source, util;
gulp = require('gulp');
sass = require('gulp-sass');
babelify = require('babelify')
browserify = require('browserify');
watchify = require('watchify');
source = require('vinyl-source-stream');
@pcreux
pcreux / mkspec.rb
Last active April 26, 2016 17:51
mkspec - Generate spec file (in vim: `:!mkspec %`)
#!/usr/bin/env ruby
DESC = "
Generate spec file
Example: mkspec app/services/user/create.rb will generate spec/services/user/create_spec.rb
"
config :my_app, :twitter_api,
client: Twitter.SandboxClient
@paulirish
paulirish / what-forces-layout.md
Last active May 31, 2024 22:37
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@josevalim
josevalim / watcher.sh
Last active May 22, 2024 10:06
A 1LOC bash script for re-running tests whenever a lib/ or test/ file changes keeping the same VM instance
# You will need fswatch installed (available in homebrew and friends)
# The command below will run tests and wait until fswatch writes something.
# The --stale flag will only run stale entries, it requires Elixir v1.3.
fswatch lib/ test/ | mix test --stale --listen-on-stdin
@wesbos
wesbos / gist:d7877929def4368cdb8abc12c5d3e38b
Last active September 9, 2020 15:21
"Out Of Office" Filter
Trying to filter "out of office" emails from my inbox as I receive a lot of them when I send a blast.
I need help - what do your "out of office" emails say in your langauge? Comment Below!
## Gmail Filter
("Automatische Antwort" OR "Automatic reply" OR "AutoReply" OR "Out of Office" OR "Xesc Duran" OR "Abwesend" OR "Absence" OR "Absence du bureau" OR "À l'extérieur du bureau" OR "Réponse automatique" OR "Abwesenheitsnotiz" OR "Resposta automática" OR "Automaattinen vastaus" OR "Automatisch antwoord" OR "Afwezig" OR "Afwezigheid" OR "Niet aanwezig" OR "Poza zasięgiem" OR "Na wakacjach" OR "Poza biurem" OR "Automatyczna odpowiedź" OR "Z dala od komputera" OR "Αυτόματη απάντηση" OR "Εκτός γραφείου" OR "na dovolenké" OR "mimo kancelárie" OR "automatická odpověď" OR "Autosvar" OR "Fora do escritório" OR "na dovolené" OR "mimo kancelář")
## List
Automatische Antwort
Automatic reply