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 / 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 / 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
(165845,'zh',''),
(217905,'zh',''),
(218110,'zh',''),
(220775,'zh',''),
(293346,'zh',''),
(309039,'zh',''),
(384276,'zh',''),
(542108,'zh',''),
(783264,'zh',''),
(921935,'zh',''),
@edouard-lopez
edouard-lopez / input.sql
Last active August 29, 2015 13:57
doing some stats
(165845,'zh',''),
(217905,'zh',''),
(218110,'zh',''),
(220775,'zh',''),
(293346,'zh',''),
(309039,'zh',''),
(384276,'zh',''),
(542108,'zh',''),
(783264,'zh',''),
(921935,'zh',''),
@edouard-lopez
edouard-lopez / makefile
Last active August 29, 2015 13:58
RANDOM variable not updated
# force use of Bash
SHELL := /bin/bash
echantillon: ${join-chinese-french}
@# default, await a value from command line
n=$$(wc -l <${join-chinese-french}); \
for i in $$(seq $$c); do \
r=$$((RANDOM % n + 1)); \
sed -n "$$r{p;q;}" ${join-chinese-french}; \
done
@edouard-lopez
edouard-lopez / dump.mk
Last active August 29, 2015 13:58
dump.makefile:31: *** commands commence before first target. Stop.
#!/usr/bin/env make
# DESCRIPTION
# Dump the database structure and data separately and update symlink
# to latest dump
#
# USAGE
# make resources/sql/dump.makefile
#
# @author: Édouard Lopez <dev+cfdict@edouard-lopez.com>
#!/usr/bin/env perl
# (1) quit unless we have the correct number of command-line args
$args_cnt = $#ARGV + 1;
if ($args_cnt != 2) {
print "\nUsage: mk2graphviz.pl input.makfile target output.svg\n";
exit;
}
# (2) we got two command line args, so assume they are the
@edouard-lopez
edouard-lopez / mk::graphviz.pl
Created April 6, 2014 13:10
Generation of makefile graph dependency using CPAN package 'Makefile::GraphViz' (see https://metacpan.org/pod/Makefile::GraphViz or https://github.com/agentzh/makefile-graphviz-pm)
#!/usr/bin/env perl
#
# DESCRIPTION
# Create makefile dependency graph based on given targets.
# Also @see ./visualize.mk
# @link: https://metacpan.org/pod/Makefile::GraphViz
#
# INSTALLATION
# pkg-install cpanminus
# cpan install Makefile::GraphViz