Skip to content

Instantly share code, notes, and snippets.

View chikamichi's full-sized avatar
🙈
You good?

Jean-Denis Vauguet chikamichi

🙈
You good?
View GitHub Profile
@chikamichi
chikamichi / lodash.md
Last active February 11, 2020 04:36
About Lodash, how it works (forEach example)

Hi!

About Lodash's forEach function, and Lodash in general…

I told you that it "abstracts away from you the chore (and complexity) of looping", so that you can focus on what really matters for your application: the collection you want to iterate through, and the piece of logic you wish to be applied for each item.

You use forEach like this:

// You first define "the collection you want to iterate through":
@chikamichi
chikamichi / base_job.rb
Last active June 6, 2016 10:07
Wrapper around DelayedJob (basic Job system for Rails)
require 'ostruct'
# Tiny wrapper around (custom) delayed jobs.
# @see https://github.com/collectiveidea/delayed_job
# @see https://github.com/collectiveidea/delayed_job#custom-jobs
#
# Create a new job by inheriting from Base Job:
#
# # app/jobs/some_task_job.rb
# class SomeTask < BaseJob
@chikamichi
chikamichi / .tmux.conf
Last active September 6, 2021 06:37
Prevent highlighting text from scrolling down (exiting copy-mode) in tmux
# Optional but convenient: use C-b v to paste the tmux buffer.
bind v paste-buffer
# Do not exit from copy-mode when selecting text.
# @see https://github.com/tmux/tmux/issues/337
# Note: the setting might be renamed MouseDragEndX.
# Depending on whether you activated tmux or vi keybindings (I'm using vi mode):
#bind -temaics-copy MouseDragEnd1Pane copy-selection -x
bind -tvi-copy MouseDragEnd1Pane copy-selection -x
@chikamichi
chikamichi / model.rb
Last active September 26, 2016 07:21
Test: double example
class Model
# Let's say Elasticsearch needs a JSON representation of the model in order
# to index it. We delegate to a specialized class to generate that JSON:
def as_indexed_json
ModelSerializer.new(self).as_json
end
end
@chikamichi
chikamichi / orthophotos_toponymes.json
Last active May 18, 2023 11:26
IGN vectorTiles - fixed by adding missing "url"
{
"version": 8,
"name": "PLAN IGN",
"glyphs":"https://wxs.ign.fr/static/vectorTiles/fonts/{fontstack}/{range}.pbf",
"sprite": "https://wxs.ign.fr/static/vectorTiles/styles/PLAN.IGN/sprite/PlanIgn",
"sources": {
"plan_ign": {
"type": "vector",
"tiles": [
"https://wxs.ign.fr/essentiels/geoportail/tms/1.0.0/PLAN.IGN/{z}/{x}/{y}.pbf"