This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
import sys | |
# use argv... example: | |
# python github-dl-count MyUserName MyRepoName | |
user = sys.argv[1] | |
repo = sys.argv[2] | |
url="https://api.github.com/repos/%s/%s/releases" % (user, repo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<canvas> | |
<simplelayout /> | |
<rtmpconnection objectencoding="3" name="mainconnect" src="rtmp://127.0.0.1/live" autoconnect="true" > | |
<method name="hello"> | |
Debug.write("server said hello...") | |
</method> | |
</rtmpconnection> | |
<rtmpstatus /> | |
<text>Orange light: warning and mybe error on server, Green OK, Red: Error</text> | |
<button>Test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
#Script de Démarrage des Ordinateurs sur l'interface réseau eth1 | |
# | |
MACADDR=00:50:BA:CB:CD:B8 | |
/usr/bin/wol -i 192.168.1.255 $MACADDR | |
#Maintenant on tourne en boucle et on attend que le pc annonce qu'il existe | |
notalive=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@startuml | |
A -> B: le label de mon appel | |
B -> A: autre label... | |
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
""" Simple Bayesian calculation | |
After training datas by categories, you can use Bayes.bayes method to compute | |
bayesian calculation to find probality for a content | |
matches some categories | |
Example: | |
>>> b = Bayes() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -up ./deploy_coreos_libvirt.sh.friend ./deploy_coreos_libvirt.sh | |
diff -up ./deploy_coreos_libvirt.sh.friend ./deploy_coreos_libvirt.sh | |
--- ./deploy_coreos_libvirt.sh.friend 2016-01-25 14:18:15.431503583 +0100 | |
+++ ./deploy_coreos_libvirt.sh 2016-01-25 14:24:35.942741966 +0100 | |
@@ -51,6 +51,12 @@ for SEQ in $(seq 1 $1); do | |
sed "s#%HOSTNAME%#$COREOS_HOSTNAME#g;s#%DISCOVERY%#$ETCD_DISCOVERY#g" $USER_DATA_TEMPLATE > $LIBVIRT_PATH/$COREOS_HOSTNAME/openstack/latest/user_data | |
+ | |
+ if [[ selinuxenabled ]] ;then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* To put in ~/.config/gtk-3.0/gtk.css */ | |
/* Create directory and file if they don't exist */ | |
/* Change paddings to fill your preferences */ | |
.header-bar.default-decoration { | |
padding-top: 1px; | |
padding-bottom: 1px; | |
} | |
.header-bar.default-decoration .button.titlebutton { | |
padding-top: 1px; | |
padding-bottom: 1px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Why DI Framework are useful | |
Dependency injection is back in fashion. That's probably the result AngularJS, Symfony2, and many Java frameworks success that offer a "DI" implementation. But what is "DI", and why are we able to *not use* "DI" framework with Python ? | |
## What is dependency injection | |
Dependency injection is a pattern, or it is rather a way to implement dependencies between classes. The approach is basically to avoid classes to directly instanciate objects, and make use of interfaces and/or factories. That's all, nothing more complicated. | |
To illustrate the definition, it's simpler to look at an example. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Patrice FERLET aka Metal3d <metal3d@gmail.com> <patrice.ferlet@smile.fr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -sSL $(curl -s https://api.github.com/repos/metal3d/goswitch/releases/latest | \ | |
grep tarball | cut -d '"' -f 4) | \ | |
tar -zxf - --strip-components=1 -C ~/.local/bin */goswitch |
OlderNewer