Skip to content

Instantly share code, notes, and snippets.

View djromero's full-sized avatar
⌨️
Working

Julián Romero djromero

⌨️
Working
  • Job&Talent
  • Madrid (Spain)
View GitHub Profile
@djromero
djromero / upload-github-release-asset.sh
Created May 27, 2017 15:30 — forked from stefanbuck/upload-github-release-asset.sh
Script to upload a release asset using the GitHub API v3.
#!/usr/bin/env bash
#
# Author: Stefan Buck
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447
#
#
# This script accepts the following parameters:
#
# * owner
# * repo
@djromero
djromero / Makefile
Created April 18, 2017 10:06
Simple makefile to update documentation with pandoc
PANDOC=/usr/local/bin/pandoc
OPTIONS=-s -S --toc --toc-depth=2 -f markdown --latex-engine=xelatex \
-V mainfont="Palatino" -V sansfont="Helvetica" -V monofont="Menlo" -V fontsize=12pt -V urlcolor=blue \
-V geometry:a4paper -V geometry:margin=2cm \
--highlight-style=tango
DOCS=user-manual.pdf installation.pdf
%.pdf : %.md
@djromero
djromero / diagram.sh
Created March 25, 2017 18:29
Generate a database schema diagram (sqlite) with SchemaCrawler
rm -f database-diagram.pdf
# Use PyCharm CE JDK
JDK="/Applications/PyCharm CE.app/Contents/jdk/Contents/Home/jre/bin/java"
"$JDK" -classpath $(echo ../../_schemacrawler/lib/*.jar | tr ' ' ':') \
schemacrawler.Main \
-server=sqlite \
-database=/Volumes/PRO/c/latenitesoft/socialbotplatform/data/social_bots_deve.db \
-password= \
@djromero
djromero / debug_on.py
Created February 6, 2017 20:17
Debug on exceptions decorator.
# http://stackoverflow.com/a/4399246/143097
import unittest
import sys
import pdb
import functools
import traceback
def debug_on(*exceptions):
if not exceptions:
@djromero
djromero / trash.sh
Created February 2, 2017 15:42
Simple shell script to move a file to ~/.Trash To invoke it in tig status view just pressing backspace.
#!/bin/sh
#
# Move a file to ~/.Trash safely in tig status view.
#
# Copy it somewhere in your PATH and add to ~/.tigrc:
#
# bind status <Backspace> !trash.sh "%(file)"
#
path=$1 && shift
date_prefix=$(date +'%Y%m%d.%H%M%S')
@djromero
djromero / Linux Static IP
Created December 27, 2016 19:51 — forked from fernandoaleman/Linux Static IP
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@djromero
djromero / volumio-timecapsule-nas.txt
Created October 28, 2016 17:41
Volumio Time Capsule NAS
# From https://volumio.org/forum/cifs-trouble-mounting-timecapsule-containing-music-t741.html
ssh -l volumio volumioip
sudo mkdir /mnt/NAS/Music
sudo chmod 777 /mnt/NAS
sudo chmod 777 /mnt/NAS/Music
# --> You might need to install cifs utils:
# if yes then use the following commands:
@djromero
djromero / config.txt
Last active October 25, 2016 10:08
Custom lines in rasplex config.txt
# http://elinux.org/RPiconfig#Video_mode_options
hdmi_force_hotplug=1 # Force HDMI even if unplugged or powered off
# --------------------------
# HDMI-to-VGA projector
hdmi_group=1 # CEA
hdmi_mode=4 # 720p
@djromero
djromero / settings.json
Created October 25, 2016 09:51
Visual Studio Code Settings
{
"editor.fontFamily": "SFMono-Regular",
"editor.fontSize": 12,
"editor.lineHeight": 16
}
# Important: you want to make a copy of Xcode 8 to be able to use it untainted for app submission, etc.
# Resign Xcode with your own signature
# https://github.com/XVimProject/XVim/blob/master/INSTALL_Xcode8.md
sudo codesign -f -s "Developer ID Application: your-developer-name" /Applications/Xcode.app
# Build the plugin
cd /path/to/XVim
# This updates DVTPlugInCompatibilityUUID and build and install the plugin
make