🎯
- GitHub Staff
- https://fjcasas.es
- @[email protected]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=merged.pdf file1.pdf file2.pdf file3.pdf | |
# -q -dNOPAUSE -dBATCH -> means just quietly and close ghostscript after running | |
# -sOutputFile=merged.pdf is the merged file | |
# file1.pdf file2.pdf file3.pdf is the list of files thar are going to be merged. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# db/seeds.rb | |
Dir.glob("#{base_dir}/*.sql").each do |file_name| | |
puts "Seeding #{ file_name }" | |
sql_file = File.new(file_name) | |
while statements = sql_file.gets("") do | |
ActiveRecord::Base.connection.execute(statements) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var property = "property_name"; | |
var object = new Object() | |
alert(object[property]) //will alert object.property_name | |
alert(object["property_name"]); //will alert object.property_name | |
alert(window["object"]["property_name"]) //will alert object.property_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializer/simple_form.rb | |
SimpleForm.setup do |config| | |
config.hint_class = "hint input" | |
config.error_class = 'error input' | |
config.wrapper_class = :clearfix | |
config.wrapper_error_class = :error | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requires fastercsv and vpim gems to be installed | |
require 'rubygems' | |
require 'fastercsv' | |
require 'vpim/vcard' | |
card = Vpim::DirectoryInfo.create([Vpim::DirectoryInfo::Field.create('VERSION', '2.1')], 'VCARD') | |
FasterCSV.foreach('contactos.csv') do |row| | |
first_name = row[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Put this file on your ~/bin, give it +x and then run it like: | |
# curl whatever.jon/it-gives.json | pjson | |
# It will print a pretty printed version of the josn file. | |
python -mjson.tool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; -*- mode: emacs-lisp; -*- | |
;; It will ask you whether those are safe values when opening a file on the project, | |
;; type `!` then to make take it as safe values :) | |
;; Take into account that it will add this as a safe value to your ~/.spacemacs | |
((nil . ((eval . (progn | |
(setq flycheck-javascript-eslint-executable | |
"/path/to/the/project/node_modules/.bin/eslint") | |
))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; To have reek to smell-check the ruby files | |
(flycheck-define-checker ruby-reek | |
"A Ruby smeel checker using reek | |
See URL `https://github.com/troessner/reek'." | |
:command ("reek" "--format=xml" | |
source-original) | |
:standard-input t | |
:error-parser flycheck-parse-checkstyle | |
:modes (enh-ruby-mode ruby-mode) | |
:next-checkers ((info . ruby-rubocop))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Emacs daemon | |
[Service] | |
Type=forking | |
ExecStart=/usr/bin/emacs --daemon | |
ExecStop=/usr/bin/emacsclient --eval "(kill-emacs)" | |
Restart=always | |
[Install] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Name=Spacemacs | |
GenericName=Text Editor | |
Comment=Edit text | |
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; | |
Exec=emacsclient -c %F | |
Icon=~/.emacs.d/core/banners/img/spacemacs.png | |
Type=Application | |
Terminal=false | |
Categories=Development;TextEditor; |