Skip to content

Instantly share code, notes, and snippets.

View c4software's full-sized avatar
🎯
Focusing

Brosseau Valentin c4software

🎯
Focusing
View GitHub Profile
@c4software
c4software / RestClient.php
Created December 12, 2013 09:29
Librairie d'appel rest
<?php
/**
* Exemples d'utilisations
* $rest = new RestClient("http://10.40.1.9:8080/afone-webcallback-ws/",False);
* $result = $rest->prepare("gestioncommande/terminecommande")->get(array("idcmde"=>666));
* TODO Fair des exemples.
*/
class RestClient {
@c4software
c4software / demo.sh
Created February 14, 2016 20:56
Tmux sync panes / terminals
Ctrl-B :
setw synchronize-panes on
import asyncio
@asyncio.coroutine
def callback(reader, writer):
while True:
data = yield from reader.readline()
writer.write(data)
yield from writer.drain()
srv = asyncio.start_server(callback, '', 8000)

Keybase proof

I hereby claim:

  • I am c4software on github.
  • I am c4software (https://keybase.io/c4software) on keybase.
  • I have a public key whose fingerprint is 96F9 8352 8758 20C2 E501 C3D3 ADDF 81C7 89CC F0F5

To claim this, I am signing this object:

document.getElementsById("monBoutton").onclick = function () {
Notification.requestPermission(function (p) {
var n = new Notification("Univ-Angers", {
icon: "http://www.univ-angers.fr/skins/UnivAngers/resources/img/logo-angers.png",
body: "Test de notification"
});
console.log(n);
});

Keybase proof

I hereby claim:

  • I am c4software on github.
  • I am c4software (https://keybase.io/c4software) on keybase.
  • I have a public key ASCpdflIgHubN9-gQayjyhCg1SY7ZmWdzOjSvu9XijX2nAo

To claim this, I am signing this object:

@c4software
c4software / demo.css
Created October 14, 2017 12:46
Centrer verticalement
.middle-centered {
display: flex;
align-items: center;
justify-content: center;
text-align: center;
min-height: inherit;
}
@c4software
c4software / yubikey-reset.sh
Created April 29, 2018 10:47 — forked from pkirkovsky/yubikey-reset.sh
Utility for resetting a Yubikey to factory defaults using gpg-connect-agent. This will wipe out any stored keys and reset PINs to default values.
gpg-connect-agent <<EOF
/hex
scd serialno
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
@c4software
c4software / download-multiple-files.js
Created June 6, 2018 08:56 — forked from noelvo/download-multiple-files.js
Download multiple files then compress to one zip file using JSZip & JSZip-utils
var zip = new JSZip();
var count = 0;
var zipFilename = "zipFilename.zip";
var urls = [
'http://image-url-1',
'http://image-url-2',
'http://image-url-3'
];
urls.forEach(function(url){
@c4software
c4software / sample.java
Created July 31, 2018 12:02
Test if user have enabled the Android Location Service.
private boolean locationServiceEnabled() {
final LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
if (locationManager != null) {
try {
return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) ||
locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
} catch (final Exception e) {
Timber.e(e);
return false;