Skip to content

Instantly share code, notes, and snippets.

View adipasquale's full-sized avatar

Adrien Di Pasquale adipasquale

View GitHub Profile
@adipasquale
adipasquale / command.sh
Last active February 13, 2024 14:35
lignes de Palissy avec REF, DPRO et PROT où PROT est rempli
xsv select "Reference,Date_et_typologie_de_la_protection,Typologie_de_la_protection" --delimiter ';' \ ‹3.3.0›
liste-des-objets-mobiliers-propriete-publique-classes-au-titre-des-monuments.csv \
| grep -ve ',$' \
> tmp/objets-with-prot.csv
@adipasquale
adipasquale / command.sh
Last active February 13, 2024 14:28
selection des lignes de Palissy où PROT est vide mais DPRO est rempli
xsv select "Reference,Typologie_de_la_protection,Date_et_typologie_de_la_protection" --delimiter ';' \ ‹3.3.0›
liste-des-objets-mobiliers-propriete-publique-classes-au-titre-des-monuments.csv \
| grep -e ',,\d' \
> tmp/objets-without-prot.csv
@adipasquale
adipasquale / logs.txt
Created February 9, 2024 10:59
logs MàJ objets 2024-02 (sans les updates d’edifices)
mise à jour de l’objet PM47001028 : {"palissy_COM"=>["Réunion(La)", "Réunion (La)"]}
mise à jour de l’objet PM85001339 : {"palissy_DENQ"=>[nil, "2023"]}
création de l’objet PM65001516 avec {:palissy_COM=>"Campan", :palissy_INSEE=>"65123", :palissy_DPT=>"65", :palissy_DOSS=>"dossier avec sous-dossier", :palissy_EDIF=>"église Notre-Dame-de-l'Assomption", :palissy_EMPL=>"choeur", :palissy_TICO=>"autel (maître-autel) avec retable, trois tableaux et leurs cadres, six panneaux peints, tabernacle et quatre chandeliers d'autel", :palissy_DPRO=>"2002/12/19 : inscrit au titre objet", :palissy_PROT=>"inscrit au titre objet", :palissy_REFA=>"PA00095358", :palissy_DENO=>"autel;retable;tableau (9);cadre (3);tabernacle;chandelier d'autel (4)", :palissy_CATE=>"menuiserie;sculpture", :palissy_SCLE=>"17e siècle;18e siècle;19e siècle", :palissy_DENQ=>nil}
mise à jour de l’objet PM73002156 : {"palissy_EMPL"=>["grenier", nil]}
mise à jour de l’objet PM73002131 : {"palissy_EMPL"=>["armoire abside", nil]}
création de l’objet PM6200
@adipasquale
adipasquale / fetch_mappings_cog_communes_fusionnees.js
Last active May 16, 2023 08:33
Communes fusionnées françaises : mappings anciens -> nouveaux COG (codes INSEE)
// nodeJS > 18 script without additional dependencies
const https = require("https")
const URL = require('url')
const fs = require('fs')
const fetchUrl = (url, callback) => {
const parsed = new URL.URL(url)
https.get(url, response => {
if (response.statusCode >= 300 && response.statusCode < 400) {
@adipasquale
adipasquale / automator_action_mp4.ruby
Last active May 11, 2023 13:36
Compress and convert videos with ffmpeg and automator
# open Automator
# create a new quick action
# select Movie files in Finder
# add action "Run Shell Script"
# select ruby as the shell and pass inputs as arguments
# enter this
require 'time'
ARGV.each do |input_path|
@adipasquale
adipasquale / equipe-collectif-objets.md
Created March 26, 2023 13:54
equipe collectif objets

image

@adipasquale
adipasquale / departements.geojson
Last active March 21, 2023 16:15
geojson départements France DROMS rapprochés
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adipasquale
adipasquale / palissy_columns_stats.txt
Last active March 14, 2023 15:14
Statistiques de présence des champs de Palissy (POP)
ACQU - Contexte d'acquisition
values not blank : 1%
top 5 values by count :
ACQU pct
DONATION-(AURORE LAUTH SAND: 6 OCTOBRE 1952) 2311 88%
oui 195 7%
1947-1958 26 1%
dation en paiement des droits de mutation 6 0%
DEPOT-(COMITE DU TOURISME DE L'INDRE) 4 0%
---
@adipasquale
adipasquale / html2haml.sh
Created December 21, 2022 15:00
VSCode command to convert html.erb to haml
# scripts/html2haml.sh
ls $1 | sed 'p;s/.erb$/.haml/' | xargs -n2 bundle exec html2haml --ruby19-attributes -E utf-8:utf-8
ls $1 | sed 's/.erb$/.haml/' | xargs sed -i '' 's/&#xE9;/é/g'
ls $1 | sed 's/.erb$/.haml/' | xargs sed -i '' 's/&#xE8;/è/g'
ls $1 | sed 's/.erb$/.haml/' | xargs sed -i '' 's/&#xA0;/\&nbsp;/g'
ls $1 | sed 's/.erb$/.haml/' | xargs sed -i '' 's/&#xAB;/«/g'
ls $1 | sed 's/.erb$/.haml/' | xargs sed -i '' 's/&#xBB;/»/g'
ls $1 | sed 's/.erb$/.haml/' | xargs sed -i '' 's/&#xE0;/à/g'
ls $1 | sed 's/.erb$/.haml/' | xargs sed -i '' 's/&#x2019;/ʼ/g'
@adipasquale
adipasquale / active_storage_attachment_rotation.rb
Created December 15, 2022 14:06
Monkey patch Active Storage Attachment to add a rotate method - with ImageProcessing and VIPS
# config/initializers/active_storage_attachment_rotation.rb
# frozen_string_literal: true
module Rotation
def rotate!(degrees: 90)
rotated_tempfile = nil
blob.open do |original_tempfile|
rotated_tempfile = ImageProcessing::Vips.source(original_tempfile).rotate(degrees).call
end