Skip to content

Instantly share code, notes, and snippets.

View andreadellacorte's full-sized avatar
🎯
Focusing

Andrea Della Corte andreadellacorte

🎯
Focusing
View GitHub Profile
@andreadellacorte
andreadellacorte / System Design.md
Created January 24, 2021 16:34 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@andreadellacorte
andreadellacorte / query_jira.rb
Created June 5, 2020 16:23
Paginated JIRA query in Ruby
require 'json'
require 'csv'
### This is a function definition; functions are the same kind of thing you
### use in excel, like VLOOKUP - you give them a variable and they do something
### or return some variable; this one is simple, you give it a URL and it
### returns a command to be run in a shell
def make_query(url)
### This makes the request to the url you've requested; think about it as a
### browser window that does things for you and returns you data / html / etc
@andreadellacorte
andreadellacorte / query_steam.rb
Created June 2, 2020 23:23
Query Steam w/ Ruby
require 'net/http'
require 'json'
require 'csv'
GEFORCE_NOW_GAMES_URL = 'https://static.nvidiagrid.net/supported-public-game-list/gfnpc.json?JSON'
STEAM_GAME_REVIEWS_URL = 'https://store.steampowered.com/appreviews/'
STEAM_GAME_INFO_URL = "https://store.steampowered.com/api/appdetails/?appids="
def query_url(url, params="")
uri = URI(url + params)
@andreadellacorte
andreadellacorte / aliases.zsh
Last active May 27, 2020 23:37 — forked from inhji/.zshrc
zsh aliases
alias help='cat ~/.oh-my-zsh/custom/aliases.zsh'
alias aliases='vim ~/.oh-my-zsh/custom/aliases.zsh'
if [[ $OSTYPE == darwin* ]]; then
alias browse="open -a /Applications/Google\ Chrome.app"
alias wp='cd ~/Documents/Github'
elif [[ $OSTYPE == linux-gnu* ]]; then
alias wp='cd /mnt/c/Users/Andrea/Documents/Github/'
fi
@andreadellacorte
andreadellacorte / rails_on_ubuntu_zsh.sh
Last active May 29, 2020 22:24
Rails install on ubuntu + zsh
# Instructions https://cloud.google.com/ruby/rails/appengine
sudo apt-get remove ruby
sudo apt-get install build-essential
sudo apt-get install -y libssl-dev libreadline-dev zlib1g-dev
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
@andreadellacorte
andreadellacorte / dirdox2unix.sh
Created May 24, 2020 19:54
Convert a folder to unix; usage dirdox2unix <folder>
pushd $1
find . -type f -print0 | xargs -0 dos2unix
popd
#!/bin/bash
# Make a PDF look scanned.
# Extracted from https://github.com/baicunko/scanyourpdf and modified for smaller output files (compression lower density).
# Project requires ImageMagick and GhostScript. This will do the trick on Ubuntu:
# sudo apt-get install ghostscript
# sudo apt-get install imagemagick
module.exports = {
projects: [
{
displayName: "test",
setupFiles: [
"<rootDir>/jest.setup.js"
],
testMatch: [
"<rootDir>/src/__tests__/*.spec.js"
]
@andreadellacorte
andreadellacorte / stryker.conf.js
Last active October 20, 2019 18:43
stryker.conf.js
module.exports = function(config) {
config.set({
mutator: "javascript",
packageManager: "npm",
reporters: ['progress', 'dots'],
testRunner: 'jest',
testFramework: 'jest',
coverageAnalysis: 'off',
fileLogLevel: 'trace',
jest: {
@andreadellacorte
andreadellacorte / gist:8cf8c33d4497a5661c145a31f4338c61
Created October 14, 2018 13:58
Count frequency of words in a text
cat text.txt | tr '[:space:]' '[\n*]' | tr -cd "[:alnum:]\n"| tr "[:lower:]" "[:upper:]" | grep -v "^\s*$" | sort | uniq -c | sort -bnr > text.fqr