Skip to content

Instantly share code, notes, and snippets.

View charlycoste's full-sized avatar
🏃‍♂️
migrated to my own gitlab and gitlab.com #ByeMicrosoft

Charles-Édouard Coste charlycoste

🏃‍♂️
migrated to my own gitlab and gitlab.com #ByeMicrosoft
View GitHub Profile

Keybase proof

I hereby claim:

  • I am charlycoste on github.
  • I am charlycoste (https://keybase.io/charlycoste) on keybase.
  • I have a public key whose fingerprint is 27DA 7A29 3773 56CC 9114 7D3E 25BA B73A 257D 4ECE

To claim this, I am signing this object:

@charlycoste
charlycoste / Makefile
Last active September 3, 2020 18:04
Sample shell.nix for Sylius project (PHP)
.PHONY: build install test
build:
composer install --no-scripts
bin/console assets:install
bin/console sylius:install:assets
bin/console sylius:theme:assets:install
yarn install
yarn run build
yarn encore dev
@charlycoste
charlycoste / index.html
Created February 28, 2018 17:50
Quick and dirty link checker
<html>
<head>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha256-3edrmyuQ0w65f8gfBsqowzjJe2iM6n0nKciPUp8y+7E=" crossorigin="anonymous"></script>
<script>
$(function(){
$('body').html($('#tpl-form').html());
});
$(document).on('submit', function(e){
@charlycoste
charlycoste / movable.coffee
Last active August 30, 2020 15:41
Movable HTML bloc with BackboneJS
class Movable extends Backbone.View
events:
'mousedown': 'grab'
'mouseup': 'release'
'mouseleave': 'release'
'mousemove': 'move'
'mouseover': -> @$el.css 'cursor', 'grab'
move: (e)->
return unless @moving
<?php
class Perceptron
{
private $weights;
public function __construct($n)
{
for ($i=0; $i<$n; $i++) {
$this->weights[$i] = rand()/getrandmax()-0.5;
}
@charlycoste
charlycoste / ocr.php
Last active May 5, 2016 15:09
Analyse de relevés de compte LCL
<?php
$dir = './Relevés/';
$files = scandir($dir);
$regex = [
'/SOLDE INTERMEDIAIRE[^\d]+([\d ]+,\d{2})/'=>'intermediaire',
'/^\s+$/'=>'vide',
'/du \d{2}.\d{2}.\d{4} au \d{2}.\d{2}.\d{4}.*N°\s+\d+/'=>'numérotation',
'/RELEVE DE COMPTE COURANT/'=>'Titre',
Ancien solde
/^01(.{5})(.{4})(.{5})(.{3})(.{1})(.{1})(.{11})(.{2})(.{6})(.{50})(.{14})(.{16})$/
Mouvement
/^04(.{5})(.{4})(.{5})(.{3})(.{1})(.{1})(.{11})(.{2})(.{6})(.{2})(.{6})(.{31})(.{2})(.{7})(.{1})(.{1})(.{14})(.{16})$/
@charlycoste
charlycoste / download_github_bills.coffee
Last active August 29, 2015 14:13
Automatically download github bills with CasperJS
login = "<login>"
password = "<password>"
directory = "<directory>"
organization = "<organization>"
casper = require('casper').create
verbose: true
logLevel: "debug"
getLinks = ->
<w:p>
<w:pPr>
<w:pStyle w:val="Corpsdetexte"/>
<w:numPr>
<w:ilvl w:val="0"/>
<w:numId w:val="15"/>
</w:numPr>
<w:tabs>
<w:tab w:val="left" w:pos="0" w:leader="none"/>
</w:tabs>
document.onmousemove = function(e){
var rect = document.getElementById('r');
rect.setAttribute('x',e.clientX-(rect.getAttribute('width')/2));
rect.setAttribute('y',e.clientY-(rect.getAttribute('height')/2));
};
document.onclick = function(e){
var point = document.createElementNS("http://www.w3.org/2000/svg",'rect');
var rect = document.getElementById('r');