Skip to content

Instantly share code, notes, and snippets.

View diegommarino's full-sized avatar

Diego Marino diegommarino

  • Dublin, Ireland
View GitHub Profile
diegommarino / .vimrc
Last active December 1, 2020 17:01
My vim rc
" Presets
call plug#begin('~/.vim/plugged')
" On Mac OS, to copy a whole file to clipboard use '%w !pbcopy'
" Fuzzy Finder
" Needs fzf installed
" 'brew install fzf'
" 'brew install the_silver_searcher'
require "selenium-webdriver"
def setup
def select_by_label(id, label, options = {})
reverse_merge(options, how: :id)
diegommarino / pdf_notes_urls_extract.rb
Last active August 10, 2018 10:47
Extract URLs and Notes from PDFs
# Credits to
require 'pdf-reader'
class Annotations
def initialize(reader, page)
@objects = reader.objects
@page =
@all_annots = annots_on_page
diegommarino /
Last active April 12, 2018 17:10
Creating a Django sample app and deploying it to Heroku

Deploying a Django app to Heroku

This guide has the objective to show how to build a sample Django app and deploy it to Heroku. We'll go through the following steps:

  • Create a sample app
  • Database configuration
  • Configuring project to deploy to Heroku

I'll not cover how to install Django, Postgresql or configure python, assuming that you already have a configured environment.

<div id="app">
<bootstrap-alert v-if="appAlert" :message="appAlert.message" :type="appAlert.type" :dismissable="appAlert.dismissable"/>
<div id="router-content">
<div id="bootstrap-alert">
<div class="alert alert-dismissible fade show" :class="typeClass" role="alert">
<button v-if="dismissable === true" type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
def checkSum(arr, s)
hashArr = Hash[arr.each_with_index.collect { |v,i| [v,i] }]
puts hashArr
arr.each do |v|
return true unless hashArr[s-v].nil?
puts "Input the array (ex: 1,2,3,4,5)"
diegommarino / .zshrc
Created April 3, 2018 12:27
Example of function function to create a custom session in iterm2 using applescript syntax.
# Add this function to create a custom session in iterm2 using applescript
iterm-custom-session () {
osascript -e 'tell application "iTerm"
(* set the project path. You can add a bash variable too for more felxibility *)
set projectPath to "your_project_path"
select first window
tell the current window
(* Split first session in two and enter in the project path *)
activate current session
import axios from 'axios'
import router from '@/router'
const namespaced = true
const state = {
token: null,
userId: null,
user: null,
profileId: null,
isStaff: null
tmux new-session \; \
send-keys 'tail -f /var/log/monitor.log' C-m \; \
split-window -v -p 75 \; \
split-window -h -p 30 \; \
send-keys 'top' C-m \; \
select-pane -t 1 \; \
split-window -v \; \
send-keys 'weechat' C-m \;