Skip to content

Instantly share code, notes, and snippets.

View cansadadeserfeliz's full-sized avatar

Vera cansadadeserfeliz

  • Desparchado.co
  • Bogotá
  • 22:51 (UTC -05:00)
View GitHub Profile
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active December 30, 2025 11:27
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@guilherme
guilherme / gist:9604324
Last active October 10, 2024 18:27
Git pre-commit hook that detects if the developer forget to remove all the javascript console.log before commit.
#!/bin/sh
# Redirect output to stderr.
exec 1>&2
# enable user input
exec < /dev/tty
consoleregexp='console.log'
# CHECK
if test $(git diff --cached | grep $consoleregexp | wc -l) != 0
then
# Installation: https://help.ubuntu.com/community/PostgreSQL
# Creating a user: http://stackoverflow.com/questions/11919391/postgresql-error-fatal-role-username-does-not-exist
# Set password: http://stackoverflow.com/a/7696398/914332
# make dump of existing database
$ pg_dump -O -U postgres database_name | gzip > /tmp/dump.sql.gz
# create dump without data
$ pg_dump test_db_development -s > /tmp/createdb.sql
@cansadadeserfeliz
cansadadeserfeliz / gist:9923987
Last active August 29, 2015 13:57
Install Pillow or pyOpenSSL in MAC
export CPPFLAGS=-Qunused-arguments
export CFLAGS=-Qunused-arguments
brew install libjpeg
#pip install Pillow
#pip install pyOpenSSL
@cansadadeserfeliz
cansadadeserfeliz / keygen.sh
Last active August 29, 2015 14:00
generate a new ssh key
# generate a new key
ssh-keygen -t rsa -b 4096 -f ~/.ssh/my_key
# private key
cat ~/.ssh/my_key
# public key
cat ~/.ssh/my_key.pub
# add key
ssh-add ~/.ssh/my_key
@scabbiaza
scabbiaza / README.md
Created September 22, 2014 18:29
Flask with infinity scroll navigation

Flask with infinity scroll navigation

Using: Flask, SQLAlchemy, Infinite-scroll

This document has now been incorporated into the uWSGI documentation:

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

@beshkenadze
beshkenadze / react_tz.md
Last active December 21, 2023 18:22
Тестовое задание для ReactJS Frontend-разработчика

##Погодное одностраничное веб-приложение

(!) Данные можно взять с сайта openweathermap.org или с любого другого сервиса.

(!) Обязательно использовать react.js и redux.

Приложение должно уметь:

  • Добавлять/удалять города
  • Сохранять локально данные
@rj76
rj76 / run_tests.sh
Last active July 28, 2016 09:07
Run Django tests and let espeak playout the result
#/bin/bash
convertsecs() {
((h=${1}/3600))
((m=(${1}%3600)/60))
((s=${1}%60))
printf "Tests took %02d hours, %02d minutes, %02d seconds...\n" $h $m $s
}
env python manage.py test --settings settings.test_settings $1 2> logs/test_stderr.log