Skip to content

Instantly share code, notes, and snippets.

View nicokosi's full-sized avatar

Nicolas Kosinski nicokosi

View GitHub Profile
@nicokosi
nicokosi / IntelliJ IDEA shortcuts.mkdown
Last active August 29, 2015 13:56
My favourites IntelliJ IDEA shortcuts.

IntelliJ IDEA shortcuts

search action: Ctrl + Shift + A

Navigation: open class by name: Ctrl + N open file by name: Ctrl + Shift + N goto anything: Ctrl + Alt + Shift + N recent files: Ctrl + E switch file: Ctrl + Tab

@nicokosi
nicokosi / collinear-timings-brute-vs-fast.R
Last active August 29, 2015 13:56
R code that generates graph for collinear detection, week 3 assigment from Coursera MOOC "Algoritms, part I" (https://www.coursera.org/course/algs4partI). N.B.: input CSV file contains this kind of data: "n,time,algo\n10,0.497,brute\n10,0.006,fast\n# etc...".
# R code that generates graph for collinear detection, week 3 assigment from Coursera MOOC "Algoritms, part I" (https://www.coursera.org/course/algs4partI). N.B.: input CSV file contains this kind of data: "n,time,algo\n10,0.497,brute\n10,0.006,fast\n# etc...".
library(ggplot2)
d <- read.csv("collinear-timings-brute-vs-fast.csv")
d$algo <- factor(d$algo)
levels(d$algo)[levels(d$algo)=="brute"] <- "Brute force"
levels(d$algo)[levels(d$algo)=="fast"] <- "Fast"
-- http://learnyouahaskell.com
-- Starting out
-----------------------------------------------------------------------------------
-- baby's first functions http://learnyouahaskell.com/starting-out#babys-first-functions
doubleMe x = x + x
doubleUs x y = doubleMe x + doubleMe y
doubleSmallNumber x = if x > 100
then x
@nicokosi
nicokosi / proglang.rb
Last active August 29, 2015 14:09
Notes about Coursera "Programming Languages": https://www.coursera.org/course/proglang - part 3 (Ruby)
Part 3
Introduction to Ruby {
Our focus {
Pure Object-Oriented
no primitives (even numbers)
Class-based
Every object has a class that determines behavior (like Java)
// array
var myArray = [1, 2, 3];
// set
var mySet = { "foo": true, "bar": true, "baz": true };
set.foo // true
set.notExists // false
var object = { id: 126878, name: "ZALTRAP 25 mg/ml sol diluer p perf", sid: "vidal://product/126878", title: "ZALTRAP 25 mg/ml sol diluer p perf" };
@nicokosi
nicokosi / docker-nightclazz-découverte.md
Last active August 29, 2015 14:14
Notes durant le Docker nightclazz découverte de Zenika, le 05/02/2015

Docker nightclazz découverte

05/02/2015 par Mario Loriedo & Vincent Demeester

C'est une intro, prochaine session dans 1 mois

Intro

  • outil pour partager env de dev et env de prod (sysadmin) #devops: "build, ship and run" via conteneurs => + rapide, automatisation
import System.CPUTime
fibo :: Int -> Int
fibo n
| n <= 1 = n
| otherwise = fibo(n - 1) + fibo(n - 2)
getCPUTimeDouble :: IO Double
getCPUTimeDouble = do t <- System.CPUTime.getCPUTime; return ((fromInteger t) * 1e-12)
(defn lazy-inc [x]
(lazy-seq
(print ".")
(cons x (lazy-inc (inc x)))))
(print "\n take 2: ")
(take 2
(lazy-inc 1))
(print "\n first: ")
@nicokosi
nicokosi / DummyFileGenerator.groovy
Last active December 16, 2015 22:49
Groovy script that generates a text file
out = new File("C:/tmp/output.txt")
out.write "-- Dummy file header\n"
for (index in 1..5) {
out.append "line${index}\n"
}
println "Generated file ${out}."
@nicokosi
nicokosi / neo4j-gistgraph-for-fake-telco.adoc
Last active December 21, 2015 07:56
A Neo4J gistgraph (http://neo4j.com/graphgist) for a fake telco use case. Can be submitted on http://portal.graphgist.org/submit_graphgist.

Fake Telco

Let’s say that a ake telco needs to answer various questions such as:

  • contracts that are not used by any clients

  • etc…​

Setup graph: