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 / 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"
@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 / .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 / 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 / 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 / 01-using-a-node-and-a-list.elm
Created January 14, 2016 03:59
Elm - reworking the FIFO implementation from
import Graphics.Element exposing (..)
import Text
type Fifo a
= Empty | Node a (List a)
empty : Fifo a
empty =
Empty
@chikamichi
chikamichi / links.md
Last active November 6, 2015 15:42
The web basics one must actually *know* about.
@chikamichi
chikamichi / gist:5417680
Last active December 16, 2015 10:08
A fully-fledged CoffeeScript boilderplate for authoring jQuery plugin. It abides by the guidelines found at http://docs.jquery.com/Plugins/Authoring#Namespacing
###
FooBar jQuery Plugin v1.0 - It makes Foo as easy as coding Bar (?).
Release: 19/04/2013
Author: Joe Average <joe@average.me>
http://github.com/joeaverage/foobar
Licensed under the WTFPL license: http://www.wtfpl.net/txt/copying/
###
(($, window, document) ->
@chikamichi
chikamichi / data.csv
Created June 29, 2012 12:36
d3: radial stack with nest
key axis value
min 1 2
avg 1 3.6
max 1 5
min 2 3
avg 2 8.2
max 2 10
min 3 0
avg 3 2.6
max 3 8
@chikamichi
chikamichi / custom_specs.rake
Created October 12, 2011 11:03
How to add customs rspec tasks in Rails 3
# Our goal is to be able to run spec:bricks along spec, when
# using the 'rake spec' command.
# In lib/tasks/custom_specs.rake, add:
require 'rake/testtask'
require 'rspec/core/rake_task'
namespace :spec do
desc "Run bricks specs"
RSpec::Core::RakeTask.new('bricks') do |spec|