Skip to content

Instantly share code, notes, and snippets.

View artero's full-sized avatar

Juan Artero artero

  • marsbased
  • Barcelona
View GitHub Profile
@artero
artero / reload.rb
Created July 25, 2018 09:23 — forked from oriolbcn/reload.rb
Reload gem from library in Rails 5+
if Rails.env.development?
localistico_files = Dir['lib/localistico/*.rb'] + ['lib/localistico.rb']
reloader = ActiveSupport::FileUpdateChecker.new(localistico_files) do
localistico_files.each { |file| load file }
end
ActiveSupport::Reloader.to_prepare do
reloader.execute_if_updated
end
end
@artero
artero / TerminalVim.scpt
Created July 1, 2018 20:44 — forked from charlietran/TerminalVim.scpt
Open file in iTerm vim for MacOS Sierra
-- TerminalVim.app
-- This creates a shim Application that will enable you to open files from the Finder in vim using iTerm
-- To use this script:
-- 1. Open Automator and create a new Application
-- 2. Add the "Run Applescript" action
-- 3. Paste this script into the Run Applescript section
-- 4. Save the application as TerminalVim.app in your Applications folder
-- 5. In the Finder, right click on a file and select "Open With". In that window you can set TerminalVim as a default
@artero
artero / 0_reuse_code.js
Created July 21, 2017 07:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@artero
artero / _radio.sass
Created June 2, 2016 11:31 — forked from javierartero/_radio.sass
Radio buttons
$radio-color-active: $brand-primary !default
$radio-color-scale-active: 1.1 !default
$radio-box-size: 1.2em !default
$radio-box-size-padding: 2px !default
$radio-box-top: 0.05em !default
$radio-box-padding: $radio-box-size + .75em !default
.radio
input[type="radio"]
@extend .sr-only
$checkbox-color-active: $brand-primary !default
$checkbox-color-scale-active: 1.1 !default
$checkbox-box-size: 1.2em !default
$checkbox-box-top: 0.05em !default
$checkbox-box-padding: $checkbox-box-size + .75em !default
.checkbox
input[type="checkbox"]
@extend .sr-only
@artero
artero / .gitignore
Last active August 29, 2015 14:15 — forked from wwvuillemot/.gitignore
# =============== #
# Unity generated #
# =============== #
# temporary files that you do not want to share with other users
Temp/
Obj/
UnityGenerated/
Library/
# optional, but you likely do not want to store
# your builds in your git repo due to size
@artero
artero / keyrepeat.shell
Created November 5, 2012 14:36 — forked from kconragan/keyrepeat.shell
Enable key repeat in Apple Lion for Sublime Text 2 in Vim mode
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text 2 if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
@artero
artero / .bashrc
Created October 15, 2012 05:41 — forked from henrik/.bashrc
Git branch and dirty state in Bash prompt.
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
@artero
artero / buscar.md
Last active October 11, 2015 10:38
Unix como IDE de PHP

find [Buscar archivos]

El comando hace una búsqueda recursiva de archivos el comando tiene la siguiente synopsis:

Todos los argumentos son obcionales, simplificando:

find [path] [atributos] [nombre]
@artero
artero / test.md
Created September 27, 2012 22:11
test
hello jam