Skip to content

Instantly share code, notes, and snippets.

View baditaflorin's full-sized avatar

Florin Badita-Nistor baditaflorin

View GitHub Profile
@baditaflorin
baditaflorin / main.yaml
Last active May 14, 2021 11:05 — forked from kbariotis/main.yaml
Ansible playbook for deploying a Node.js app to DigitalOcean
- name: DO
hosts: localhost
vars:
project_name: "PUT A NAME FOR YOUR PROJECT HERE"
do_token: "PUT YOUR DIGITAL OCEAN API KEY HERE ==> https://cloud.digitalocean.com/settings/api/tokens"
repository: "PUT YOUR REPOSITORY URL HERE"
- name: NODE | Clone/Pull repo
git:
repo: "{{repository}}"
@baditaflorin
baditaflorin / README.md
Created April 25, 2020 03:35 — forked from clhenrick/README.md
PostgreSQL & PostGIS cheatsheet (a work in progress)
@baditaflorin
baditaflorin / similarities.sh
Created September 17, 2019 22:14 — forked from RichardBronosky/similarities.sh
Identify how similar a file is to each file in a group of others.
#!/bin/bash
fileA="$1"
shift
for fileB in "$@"; do
(
# diff once grep twice with the help of tee and stderr
diff $fileA $fileB | \
tee >(grep -cE '^< ' >&2) | \
grep -cE '^> ' >&2
@baditaflorin
baditaflorin / lda.py
Created December 26, 2016 16:06 — forked from light44/lda.py
Latent Dirichlet Allocation using gensim
import nltk
import pandas as pd
import re
import pprint
import operator
import csv
import logging
from stop_words import get_stop_words
from collections import defaultdict
from gensim import corpora
@baditaflorin
baditaflorin / README.md
Created November 28, 2016 15:59 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@baditaflorin
baditaflorin / mapillary2exif.sh
Created August 26, 2016 07:20 — forked from cquest/mapillary2exif.sh
Bash script to copy Mapillary pictures from an iPhone, and update the EXIF data
#!/bin/bash
# This bash script copies pictures from Mapillary folders stored on an iPhone
# then update the pictures EXIF data to get the GPS and timestamp
# written by Christian Quest - August 2016
# requires jq and exiftool, if missing: apt install jq exiftool
# tested on Ubuntu 16.04
# copy Mapillary internal json data (contains GPS info, and more)
rsync /run/user/1000/gvfs/afc*/com.mapillary.app/cameras/internal/ internal -a
@baditaflorin
baditaflorin / postgres-cheatsheet.md
Created July 21, 2016 08:25 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*