Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
week-end project: trading bot

Julian Bilcke jbilcke

🎯
week-end project: trading bot
View GitHub Profile
@jbilcke
jbilcke / graph.js
Created Apr 29, 2017
Vis.js graph component for Idyll
View graph.js
const React = require('react');
const IdyllComponent = require('idyll-component');
const Graph = require('react-graph-vis').default;
const options = {
layout: {
hierarchical: true
},
edges: {
color: "#000000"
View Unicode JS
Unicode = {
/* Strings to match Unicode characters in the BMP according to their Unicode category.
Extracted from Unicode specification, version 5.0.0, source:
http://unicode.org/versions/Unicode5.0.0/
*/
/*
Abbr Long Description
Lu Uppercase_Letter an uppercase letter
Ll Lowercase_Letter a lowercase letter
Lt Titlecase_Letter a digraphic character, with first part uppercase
View Charts.js
'use strict'
import React, { Component, PropTypes } from 'react'
import { findDOMNode } from 'react-dom'
import c3 from 'c3'
import 'c3/c3.css'
const emptyFunc = () => {};
@jbilcke
jbilcke / array.js
Last active Aug 23, 2016
Array<Array>, Array<{}> or Array<Object>? tests made with node 6.3.0 on a mac
View array.js
// Execution time: 1048
// { rss: 1028186112, heapTotal: 1015271424, heapUsed: 969132048 }
var start = new Date().getTime();
var arr = [];
for (i = 0; i < 10000000; ++i) {
arr.push([Math.random(), Math.random()])
}
@jbilcke
jbilcke / total.js
Created Mar 7, 2016
Calcul du total par personne
View total.js
function total(opts){
var plats = opts.plats.reduce((r,p) => r + p)
return plats + (opts.livraison / opts.nbPersonnes) - (plats * opts.reduction)
}
total({
plats: [3.10, 8.20, 0.30], // prix des plats d'une personne
livraison: 1.50, // 12h-13h
reduction: 0.15, // 15%
View keybase.md

Keybase proof

I hereby claim:

  • I am jbilcke on github.
  • I am jbilcke (https://keybase.io/jbilcke) on keybase.
  • I have a public key whose fingerprint is 47AA F05A C297 E551 759B 1F43 8196 921E 4F86 F8A8

To claim this, I am signing this object:

@jbilcke
jbilcke / gist:6537280
Created Sep 12, 2013
"It is possible to stream a request directly to a Node.js Stream object by calling the createReadStream() method on a request. " http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/makingrequests.html
View gist:6537280
(new AWS.S3()).getObject(Bucket: 'myBucket', Key: 'myImageFile.jpg').createReadStream().pipe(require('fs').createWriteStream('/path/to/file.jpg'))
@jbilcke
jbilcke / run.sh
Created Aug 28, 2013
How to run Gephi from sources
View run.sh
#!/bin/bash
cd modules/application && mvn nbm:cluster-app nbm:run-platform
@jbilcke
jbilcke / after.coffee
Created Jul 31, 2013
wrapper for checking returned values in coffee
View after.coffee
result = do (value=some(operation(42))) ->
throw Error "too low" if value < 0.5
value
@jbilcke
jbilcke / ios7_bookmarklet
Last active Dec 18, 2015
Add some iOS7 swag to your website
View ios7_bookmarklet
javascript: WebFontConfig = { google: { families: [ 'Lato:100,300:latin' ] } };(function() { var wf = document.createElement('script'); wf.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';wf.type = 'text/javascript'; wf.async = 'true'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(wf, s); })();var css = document.createElement("style");css.type ="text/css"; css.innerHTML ="body { filter: saturate(400%); -webkit-filter: saturate(400%); -moz-filter: saturate(400%); -o-filter: saturate(400%); -ms-filter: saturate(400%); font-family: 'Lato', sans-serif !important; font-weight; 300; }"; document.body.appendChild(css);