Skip to content

Instantly share code, notes, and snippets.

View juanfgs's full-sized avatar

Juan Francisco Giménez Silva juanfgs

View GitHub Profile
@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
@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;
;; 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 ()
# 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!
#!/bin/bash
inc()
{
shopt -s extglob
num=$(echo "$release_version" | sed 's/^\([0-9]*\)\.[0-9]*\.[0-9]*/\1/g')
let num++
echo "$num.0.0"
}
#!/bin/bash
inc()
{
shopt -s extglob
num=$(echo "$release_version" | sed 's/^[0-9]*\.\([0-9]*\)\.[0-9]*/\1/g')
let num++
echo $release_version | sed -r "s/^([0-9]*)\.[0-9]*\.[0-9]*$/\1.$num.0/"
}
[alias]
brr = branch -r
br = branch
ci = commit -m
cia = commit -a -m
amend = commit --amend -C HEAD
co = checkout
cob = checkout -b
st = status -sb
me = merge --no-ff
#!/bin/bash
inc()
{
shopt -s extglob
num=$(echo "$release_version" | sed 's/^[0-9]*\.[0-9]*\.//g')
let num++
echo $release_version | sed -r s/[0-9]*$/$num/
}
require 'rake/testtask'
Rake::TestTask.new do |t|
t.libs << ["spec", "lib" ]
t.pattern = "spec/**/*_spec.rb"
end
@juanfgs
juanfgs / Gemfile
Created December 5, 2017 23:02
Implementation
source 'https://rubygems.org/'
gem 'minitest'