Skip to content

Instantly share code, notes, and snippets.

View angeliski's full-sized avatar

Rogerio Angeliski angeliski

View GitHub Profile
@angeliski
angeliski / hash_array_to_csv.rb
Created February 4, 2020 17:38 — forked from christiangenco/hash_array_to_csv.rb
Ruby hash array to CSV
class Array
def to_csv(csv_filename="hash.csv")
require 'csv'
CSV.open(csv_filename, "wb") do |csv|
csv << first.keys # adds the attributes name on the first line
self.each do |hash|
csv << hash.values
end
end
end
@angeliski
angeliski / ubuntu_agnoster_install.md
Created March 19, 2018 21:27 — forked from renshuki/ubuntu_agnoster_install.md
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@angeliski
angeliski / server.js
Created February 15, 2018 12:06 — forked from philcms1/server.js
Sample Express.js configuration with Webpack-dev-middleware, to allow with backend authentication.
/**
* Created by Phil on 02/23/17.
*/
// BASE SETUP
// ================================================================================================
// Imports
const express = require('express');
const app = express();
const bodyParser = require('body-parser');
const path = require('path');
@angeliski
angeliski / protips.js
Created January 6, 2016 15:12 — forked from nolanlawson/protips.js
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");