Skip to content

Instantly share code, notes, and snippets.

View fprieur's full-sized avatar

Fred Prieur fprieur

  • Ubisoft
  • Montreal
View GitHub Profile
@fprieur
fprieur / git-file-mode.md
Created February 24, 2015 19:13
How do I make Git ignore file mode (chmod) changes?

How do I make Git ignore file mode (chmod) changes?

git config core.fileMode false

@fprieur
fprieur / ssh-key-authorized.md
Created February 18, 2015 15:43
Push SSH key to Authorized Keys

Using ssh-copy-id to Push SSH key to Authorized Keys

ssh-copy-id -i ~/.ssh/id_rsa.pub [user@yourhost]

@fprieur
fprieur / tests.md
Last active August 29, 2015 14:14
Les différents type de tests...

Les différents type de tests

Les tests unitaires

Les tests unitaires consistent à tester individuellement les composants de l’application. On pourra ainsi valider la qualité du code et les performances d'un module.


Les tests d'intégration

Ces tests sont exécutées pour valider l'intégration des différents modules entre eux et dans leur environnement exploitation définitif.

@fprieur
fprieur / only-number-and-line-grep.md
Created February 3, 2015 19:47
vdm - bash - only show line number and string in line with grep

with grep, to show only line number and string on the line: grep -n "[string_to_search]" [filename] |cut -f1,2 -d:

@fprieur
fprieur / branch-prompt.md
Last active August 29, 2015 14:14
vdm - git - mettre nom branch dans bash prompt

Executer cette commande dans le terminal

curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh -o ~/.git-prompt.sh

Ajouter ces lignes à la fin de du fichier ~/.bashrc

  • source ~/.git-prompt.sh
  • PS1="[$GREEN]\t[$RED]-[$BLUE]\u[$YELLOW][$YELLOW]\w[\033[m][$MAGENTA]$(__git_ps1)[$WHITE]$ "

vu ici

@fprieur
fprieur / git-lg.md
Last active August 29, 2015 14:14
vdm - git - ajouter git lg (un meilleur git log)

git lg (un meilleur git log)

Il suffit de faire cette commande dans le terminal git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit"

@fprieur
fprieur / scrap_ckan_resource.py
Created January 12, 2015 21:29
Scan montreal open data resource
# coding: utf-8
from bs4 import BeautifulSoup
import requests
import json
r = requests.get("http://donnees.ville.montreal.qc.ca/api/3/action/package_list")
binary = r.content
output = json.loads(binary)
for package in output["result"]:
@fprieur
fprieur / ckan_resource_updater.py
Created December 22, 2014 22:58
Ckan resource updater
# -*- coding: utf8 -*-
import json
import requests
from ConfigParser import SafeConfigParser
from urlparse import urlparse, urlunparse
import urllib
config = SafeConfigParser()
config.read('field_uploader.ini')
@fprieur
fprieur / README.md
Last active August 29, 2015 14:11
Convert from json to csv datasets from donnees.ville.montreal.qc.ca

How to convert a json file to csv for a given ckan api call

Requirements

Get the json file

This command will retrieve the last 100 datasets created with the metadata_created date from 2014-01-01 from 2014-12-15 from donnees.ville.montreal.qc.ca

http donnees.ville.montreal.qc.ca/api/3/action/package_search q=metadata_created:'[2014-01-01T00:00:00Z TO 2014-12-15T23:59:59Z]' rows=100

Then you want to save to a json the results

@fprieur
fprieur / remotemysqldump
Created November 14, 2014 14:59
mysqldump with remote mysql server
nice -n15 mysqldump -h[remoteservername] -u [mysqluser] -p[mysqlpass] [databasename] > mydumpfile.sql