Skip to content

Instantly share code, notes, and snippets.

Avatar

Sylvain Machefert symac

View GitHub Profile
View test_recouvrement.sql
TRUNCATE `3IN_SSID`;
SET CHARACTER SET 'utf8';
SET collation_connection = 'utf8_general_ci'
LOAD DATA LOCAL INFILE "/home/smachefert/Bureau/DG_201803/3IN_SSID.csv" INTO TABLE `3IN_SSID` FIELDS TERMINATED BY "," ENCLOSED BY '"' LINES TERMINATED BY "\n" IGNORE 1 LINES;
# mise à jour de la base après chargement :
ALTER TABLE `3IN_SSID` ADD `LN` BOOLEAN NOT NULL DEFAULT FALSE AFTER `PublisherName`;
ALTER TABLE `3IN_SSID` ADD `coverage` VARCHAR(255) NOT NULL AFTER `LN`;
UPDATE 3IN_SSID set LN = 1 where Resource like '%ational%';
update 3IN_SSID set coverage = CONCAT(StartDate, " - ", EndDate) where EndDate != '' or StartDate != '';
View addIdRef.py
# -*- coding: utf-8 -*-
#!/usr/bin/python
import pywikibot
import sys
site = pywikibot.Site("fr", "wikipedia")
repo = site.data_repository()
# Création de l'affirmation qui sera utilisée pour sourcer les informatiosn ajoutées
# => importé de : idref ( https://www.wikidata.org/wiki/Q47757534 )
View sudoctest.user.js
// ==UserScript==
// @name Unnamed Script 983182
// @version 1
// @grant none
// @require https://code.jquery.com/jquery-3.2.1.js
// ==/UserScript==
$( document ).ready(function() {
$("*").css("color", "red");
View députés.csv
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 2.
depute nom BNF - URL BNF - Bio BnF Bio - politique BN - Bio député BNF - Date de naissance BNF - Nom countResults idBnF year DDN DDN - BnF Q P268 BNF - Identifiant
http://www.wikidata.org/entity/Q980870 Henri Collomb http://catalogue.bnf.fr/ark:/12148/cb11140818k Médecin et universitaire. - Professeur agrégé de médecine générale au service de santé de la France d'outre-mer puis professeur de neuropsychiatrie à la Faculté de médecine et de pharmacie de Dakar. - Docteur en médecine (Bordeaux, 1937-1938) false false 19131214 19791009 Collomb, Henri 1 1913 19130101 19131214 Q980870 P268 """11140818k"""
http://www.wikidata.org/entity/Q2865047 Arthur Chaussy http://catalogue.bnf.fr/ark:/12148/cb12652278g false false 1880 1945 Chaussy, Arthur 1 1880 18800118 1880 Q2865047 P268 """12652278g"""
http://www.wikidata.org/entity/Q2959273 Charles Guillemaut http://catalogue.bnf.fr/ark:/12148/cb15325431c Général. - Il passa par l'Ecole d'application de Metz et servit dans le Génie en France et en Algérie fa
View keybase.md

Keybase proof

I hereby claim:

  • I am symac on github.
  • I am symac (https://keybase.io/symac) on keybase.
  • I have a public key whose fingerprint is 99F7 E16C DD8C 2D3F D23C A2FD 7C89 F02A BCD9 7F15

To claim this, I am signing this object:

@symac
symac / README.md
Last active May 5, 2017
Ezproxy redirect
View README.md

Files used when we moved our EzProxy to new domain name. Details on this blog post

View test.html
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<script src="pageviews.min.js"></script>
<script src="pageviews.min.js"></script>
<script>
// Getting pageviews for a single article
@symac
symac / needhost.htm
Created Feb 28, 2017
Redirecting to a new EzProxy server
View needhost.htm
!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Information mise à jour serveur</title>
<meta name="description" content="Information redirection">
<meta name="author" content="Université Bordeaux Montaigne">
View bplus.php
<?php
$url_bplus = "http://babordplus.univ-bordeaux.fr/notice.php?q=provenance:PPN".$ppn."&spec_expand=1&start=0&ct=bx3_alone&ce={UAI}0331766R";
$page = file_get_html($url_bplus); # Fonction dispo dans http://simplehtmldom.sourceforge.net/
$notice = $page->find("div[class=sid-result-notice] div[class=sid-infos]", 0);
if ($notice == "")
{
print "Pas de notice dans B+ pour $ppn [$record_id]\n";
}
View pm.js
// ==UserScript==
// @name ParisMuséeDownload
// @namespace pm
// @include http://parismuseescollections.paris.fr/*
// @version 1
// @grant none
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// ==/UserScript==
$( document ).ready(function() {
You can’t perform that action at this time.