Skip to content

Instantly share code, notes, and snippets.

View edouard-lopez's full-sized avatar
🏠
Working from home

Édouard Lopez edouard-lopez

🏠
Working from home
View GitHub Profile
@edouard-lopez
edouard-lopez / char_with_at_least_2_hanyu_pinyin.sh
Created September 8, 2013 13:06
Ratio of possible ambiguous pronunciation in a ruby-like font for Chinese. Data gather on Unihan database 6.2.0 * Character with ≥2 Hanyu Pinyin: 8119 * Total Character with Hanyu Pinyin: 34132
awk '/kHanyuPinyin/ && /,/ {print $3}' ./resources/unihan/Unihan_Readings.txt | wc -l
8119
@edouard-lopez
edouard-lopez / input-丂-x4E02.svg
Created September 9, 2013 11:30
Hanzi Pinyin Font from multiple <svg:text> elements to a single <svg:path> (Union path operations)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@edouard-lopez
edouard-lopez / e.bash
Created October 24, 2013 17:04
Open given file with adequate rights (sudo/user)
# @description Open given file with adequate rights (sudo/user)
# @param $@|$f file(s) name
# @return void
function e() {
f="$1"
owner="$(stat -c '%G:%U' $f)"
ownerUser="${owner%%:*}"
ownerGroup="${owner##*:}"
@edouard-lopez
edouard-lopez / md5check.bash
Created November 6, 2013 23:33
Compare a file computed md5sum against official checksum
# @description Check a file computed md5sum against official one
# @param $1|file file to checksum
# @param $2|controlChecksum official/valid checksum
# @return void
function md5check() {
controlChecksum="$2"
if [[ ! -e "$1" || -z "$2" ]];
then
[[ ! -e "$1" ]] && printf "[!] File not found\n"
@edouard-lopez
edouard-lopez / Gruntfile.js
Created January 10, 2014 09:24
Running "autoprefixer:dist" (autoprefixer) task File ".tmp/styles/main.css" created. Running "handlebars:compile" (handlebars) task File "app/scripts/screenshots.hbs.js" created. >> No "concat" targets found. Warning: Task "concat" failed. Use --force to continue. Aborted due to warnings.
// Generated on 2014-01-10 using generator-webapp 0.4.6
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
module.exports = function (grunt) {
@edouard-lopez
edouard-lopez / app.js
Last active August 29, 2015 13:55
Missing provider for filters "Error: [$injector:unpr] Unknown provider: $pinyinFiltersProvider <- $pinyinFilters
'use strict';
var cfdictApp = angular.module('cfdictApp',
[
'ngRoute',
'textAngular',
'ui.bootstrap',
'pinyinFilters'
]);
@edouard-lopez
edouard-lopez / gist:8708159
Created January 30, 2014 13:21
linux Distribution
> > Ce qui nous fait une 3ème famille d'Unix libres avec BSD et GNU.
> Yes
4 si tu ajoutes Darwin
http://fr.wikipedia.org/wiki/XNU
https://fr.wikipedia.org/wiki/Darwin_(informatique)
http://www.puredarwin.org/
http://www.gnu-darwin.org/index.php?page=about
@edouard-lopez
edouard-lopez / output.txt
Last active August 29, 2015 13:56
Encoding error
python subtlex-parser.py
的: <type 'unicode'>
[[]]
Traceback (most recent call last):
File "subtlex-parser.py", line 32, in <module>
app = subtlexParser() # création de l'appli
File "subtlex-parser.py", line 17, in __init__
self.convert()
File "subtlex-parser.py", line 29, in convert
outf.write(line)
@edouard-lopez
edouard-lopez / makefile
Created March 17, 2014 23:16
GRIB2 installation of environnement and conversion to CSV
#!/usr/bin/env make
# DESCRIPTION
# GRIB2 installation of environnement and conversion
# see: https://gis.stackexchange.com/questions/26356/conversion-of-grib-and-netcdf-to-my-database
#
# USAGE
# make extract-data
#
# @author: Édouard Lopez <[email protected]>
@edouard-lopez
edouard-lopez / worldtime.bash
Last active August 29, 2015 13:57
date-related snippets
# Display date H:M (mon-day) for a list of predefined timezones.
# The list of timezones available in: /usr/share/zoneinfo/
#
# @return string
worldtime() {
places=( "America/New_York" "Asia/Kolkata" "Europe/Paris" )
for tz in ${places[@]};
do
time=$(TZ="$tz" date '+%H:%M (%b-%d)')
printf "%s: %s\n" "${tz##*/}" $time