Skip to content

Instantly share code, notes, and snippets.

View juanfgs's full-sized avatar

Juan Francisco Giménez Silva juanfgs

View GitHub Profile
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
;; Global Include
(add-to-list 'load-path ".../git/contrib/emacs")
(add-to-list 'load-path (expand-file-name "~/.emacs.d/lisp"))
;; Theme & Appearance
;;(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/emacs-deviant-theme")
;;(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/emacs-colors-solarized")
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/smyx-master")
(set-face-attribute 'default nil :height 108) ;; font size
(defun enable-custom-theme ()
@juanfgs
juanfgs / mp4subtitles.sh
Created August 12, 2015 13:43
Set Wallpaper
#!/bin/sh
cd .;
ffmpeg -i $1 -vcodec copy -acodec copy temp.mkv;
CHARSET=`file -bi $2 | sed -e 's/.*[ ]charset=//'`;
if [ $CHARSET == "utf-8" ];then
cp $2 subtitle.srt;
else
iconv -f iso8859-15 -t UTF-8 $2 > subtitle.srt;
fi
mkvmerge -o $1.mkv temp.mkv --language "0:es" --track-name "0:mytrackname" -s 0 -D -A subtitle.srt;
@juanfgs
juanfgs / CommentsController.rb
Last active August 29, 2015 14:15
issues with recaptcha
class CommentsController < ApplicationController
def create
@post = Post.find(params[:comment][:post_id])
@comment = Comment.new
@comment.name = params[:comment][:name]
@comment.comment = params[:comment][:comment]
if verify_recaptcha(:model => @comment) && @comment.valid?
@post.comments << @comment
redirect_to :back, flash: {message: "Thank you for your comment "}
else