Skip to content

Instantly share code, notes, and snippets.

@ivangeorgiev
ivangeorgiev / nodejs-cheatsheet.js
Created October 5, 2015 19:31
Node.js Cheat .Sheet
// Global Objects
// https://nodejs.org/api/globals.html
__filename; // The filename (resolved absolute path) of the code being executed.
__dirname; // The name of the directory that the currently executing script resides in. (absolute path)
global; // The global namespace object.
process; // The process object https://nodejs.org/api/process.html
process.chdir(directory); // Changes the current working directory of the process or throws an exception if that fails.
@ivangeorgiev
ivangeorgiev / array-min.js
Created October 12, 2015 22:15
Array.min() Method
/**
* Get the minimum value from array.
* @param getter Optional function for mapping array elements to actual comparison value.
* Examples:
* lengths.min();
* persons.min(function(person) { return person.age; });
*/
Array.prototype.min = function(getter) {
var val;
getter = getter || function(v) { return v; }
@ivangeorgiev
ivangeorgiev / array-max.js
Created October 12, 2015 22:16
Array.max() Method
/**
* Get the maximum value from array.
* @param getter Optional function for mapping array elements to actual comparison value.
* Examples:
* lengths.max();
* persons.max(function(person) { return person.age; });
*/
Array.prototype.max = function(getter) {
var val;
getter = getter || function(v) { return v; }
@ivangeorgiev
ivangeorgiev / close.csv
Created October 18, 2015 12:33
My Data
date close
1-May-12 58.13
30-Apr-12 53.98
27-Apr-12 67.00
26-Apr-12 89.70
25-Apr-12 99.00
24-Apr-12 130.28
23-Apr-12 166.70
20-Apr-12 234.98
19-Apr-12 345.44
@ivangeorgiev
ivangeorgiev / index.html
Created October 18, 2015 12:38
Very Simple Chart with D3
<!DOCTYPE html>
<meta charset="utf-8">
<style> /* set the CSS */
body { font: 12px Arial;}
path {
stroke: steelblue;
stroke-width: 2;
fill: none;
@ivangeorgiev
ivangeorgiev / wk3_data_management.py
Last active October 31, 2015 21:14
Data Management and Visualization Assignments
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 31 20:45:05 2015
@author: baobab
"""
import pandas;
import numpy as np
import matplotlib.pyplot as plt
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 31 20:45:05 2015
http://stanford.edu/~mwaskom/software/seaborn/tutorial/distributions.html#plotting-univariate-distributions
http://stanford.edu/~mwaskom/software/seaborn/generated/seaborn.distplot.html#seaborn.distplot
http://stanford.edu/~mwaskom/software/seaborn/generated/seaborn.regplot.html?highlight=regplot#seaborn.regplot
@author: baobab

Scala Notes

Tools Install for Linux

Install JDK

sudo apt-get install openjdk-8-jdk
@ivangeorgiev
ivangeorgiev / Dockerfile
Last active May 30, 2019 07:28
Optimize image files for web site.
# Docker image with ImageMagick installed
#
# To build a docker image, execute:
# docker build -t imagick .
#
# To create a docker container, execute:
# docker run -it --rm --name imagick -v ${PWD}:/mydata -w /mydata imagick
FROM ubuntu:19.04
RUN apt-get update \