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
# utilisation de l'attribut `paid` | |
>>> payment = payplug.get_payment(id='pay_CD9SCD') | |
>>> payment.paid # Est-ce payé ? Ou est-ce la date de paiement ? c'est pas limpide. | |
# utilisation de l'attribut `is_paid` | |
>>> payment = payplug.get_payment(id='pay_CD9SCD') | |
>>> payment.is_paid # c'est payé, on a pas de doute on sait tout de suite que l'on peux l'utiliser dans nos conditions |
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
CamelCase | snake_case | |
---|---|---|
Langage de script | Language compilé ou hérité du compilé | |
Python, Ruby | C/C++, Java, PHP | |
JSON | XML / SOAP |
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 PythonMagick | |
from pyPdf import PdfFileWriter,PdfFileReader | |
input1 = PdfFileReader(file('/home/steph/menu.pdf', 'rb')) | |
p2=input1.getPage(1) | |
writer=PdfFileWriter() | |
writer.addPage(p2) | |
import io | |
f=io.BytesIO() | |
writer.write(f) | |
blob=pm.Blob(f.read()) |
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
<?php | |
$url_config = 'https://www.payplug.fr/portal/ecommerce/autoconfig'; | |
$process = curl_init($url_config); | |
$email = 'your_payplug_email@test.com'; | |
$password = 'your_password'; | |
curl_setopt($process, CURLOPT_USERPWD, $email.':'.$password); | |
curl_setopt($process, CURLOPT_RETURNTRANSFER, TRUE); | |
curl_setopt($process, CURLOPT_SSLVERSION, 3); | |
$answer = curl_exec($process); | |
$error_curl = curl_errno($process); |
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
-----BEGIN PUBLIC KEY----- | |
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtN4dpK368PEEYKeee7S5 | |
1m2a8GUFLDAZ/HgRI1H6diYt87gzDPftn1UyW96YuIBed0T0dtl0tuABaIgGeddR | |
uo3zfMpkyYWM2D5UHUEMKzEY5WIyaaWoVYJaZU5DWzCiroKcnUJgKm41RL32/CHU | |
SFoymxjOOzpvkazbaY+Ql2GYev2QwKAf7lkH91Wp3frjQYXEFIwYnt6ZET8wPUwX | |
MdF0hRaZYlaDQrCB2S/+k4Djb8mXqVkJ0qqgItycL05zyysJw/IGMr2zZ5hQSnfN | |
CJ+i33ywnoT/qctGgLW4bGuGdTdcbA7VzdxhXtHaAQjuJvrf+twNCQSLCMbZ6pnK | |
zQIDAQAB | |
-----END PUBLIC KEY----- |
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
-----BEGIN RSA PRIVATE KEY----- | |
MIIEpAIBAAKCAQEA3qWSlqpUaFANxGRkOm+4CK+ObPWa38vq6S4HQJ0gcEi5Go0T | |
Ylv2ukq4xqMy6turCc/jCly/k+hyXq1tnYKOs7yqJ8KINTsl8dToHHwPi7uxe9ip | |
zCr3eAO8hG0HhqK2DKFqLKFRcmVbmDWXbzrLzmi1wAkP6YdIDDAUbPU/MpxqHOPL | |
RYqkltoTxCgpamddOercGaGpS+QCvzIw6UAY6CxSPEFvohemfUsq0ltK24Sbhqgn | |
/duyDYn9yP7rVE7nRDyYifbjvKmo9YjpSGSsCDZnVXTNEvigmj893VtdmvFzjsIi | |
W6k9Wf0cUZ1kp9cQ19PyozTw4is93MroZA4hTwIDAQABAoIBABBphh/DGIvD8u/a | |
MqU4HQnO3yHbDPqYTo23zeMOchi006hIY/hpLQvYfDxwRU2Yucf0YhkecyTVCrE9 | |
+YmV2S0YqDZcGaxK2uYzupR29LJpOJEXjJS3Shy3scrVOqvLDL5rm6cEkTtsi07y | |
DGKvo9xoTZWFVX3ycfYsCSVrAqiZSdd3E+uaPUzhNc0N6ajfr8iZpOetFu93CP6Y |
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
<?php | |
if(!function_exists('getallheaders')){ | |
function getallheaders(){ | |
$headers = array(); | |
foreach ($_SERVER as $name => $value){ | |
if(substr($name, 0, 5) == 'HTTP_'){ | |
$name = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5))))); | |
$headers[$name] = $value; | |
} else if($name == "CONTENT_TYPE") { | |
$headers["Content-Type"] = $value; |
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
export PATH="/usr/lib/colorgcc/bin:$PATH" |
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
[user] | |
name = Stéphane Planquart | |
email = stephane@planquart.com | |
[color] | |
branch = auto | |
diff = auto | |
interactive = auto | |
status = auto | |
[alias] | |
st = status |
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
#!/usr/bin/python | |
import sys | |
from flake8.engine import get_style_guide as get_style_guide | |
import os | |
import shutil | |
from tempfile import mkdtemp | |
from flake8.main import DEFAULT_CONFIG | |
COMPLEXITY = 10 | |
STRICT = True |