Skip to content

Instantly share code, notes, and snippets.

@lesm
lesm / .gitconfig
Last active November 28, 2022 22:48
[user]
name = Luis Silva
email = silmar.dll@gmail.com
[core]
editor = nvim
excludesfile = /home/silva/.gitignore_global
; excludesfile = /Users/silva/.gitignore_global
[push]
default = current
[pull]
@lesm
lesm / install fonts
Created January 23, 2016 08:01
Install fonts Andale Mono, Arial, Arial Black, Comic Sans MS etc...
ccr ttf-ms-fonts
mkdir ~/.fonts
wget -qO- http://plasmasturm.org/code/vistafonts-installer/vistafonts-installer | bash
@lesm
lesm / molokai.vim
Last active March 26, 2021 06:35
Theme for vim
" Vim color file
"
" Author: Tomas Restrepo <tomas@winterdom.com>
"
" Note: Based on the monokai theme for textmate
" by Wimer Hazenberg and its darker variant
" by Hamish Stuart Macpherson
" by Luis Silva and its variant
set background=dark
echo "Descargango Bluej"
cd /tmp/ && wget http://www.bluej.org/download/files/bluej-316.jar
echo "Instalando Bluej"
java -jar bluej-316.jar
echo "Moviendo instalación de bluej a /opt/bluej"
su -c "mv /tmp/bluej /opt/bluej"
cd /opt/bluej
echo "Descargando imagen para bluej"
su -c "wget \"https://www.google.com.mx/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0ahUKEwjh2O_sz-XOAhUFSSYKHSVbA8YQjRwIBw&url=http%3A%2F%2Fwww.freeiconspng.com%2Ficons%2Fbluej-icon-png&bvm=bv.131286987,d.cGc&psig=AFQjCNGoZqsQPLN0CdFMYhu2Z0zYalPwtA&ust=1472525699271529\" -O bluej.png"
su -c "echo \"[Desktop Entry]\n
var formData = new FormData(),
$input = $('#avatar');
formData.append('user[avatar]', $input[0].files[0]);
$.ajax({
url: this.model.url(),
data: formData,
cache: false,
contentType: false,
psql -U rails -d name_database -f ./file.sql -h localhost
scp user:domain:/path/file .
ssh-add
BRANCH_NAME=my_branch cap staging deploy
git reset --hard origin/master
CREATE EXTENSION unaccent;
Host *
ServerAliveInterval 60
:new-session -s name -c "/home/silva/..."
@lesm
lesm / update_multiple_git_repositories.sh
Created March 16, 2017 10:03 — forked from apux/update_multiple_git_repositories.sh
Update multiple git repositories
#!/bin/sh
dirs=`ls -1d */`
for d in $dirs
do
echo $d
echo '======================'
IFS=$'\n' lines=($(cd $d; git pull))
for l in $lines
do
echo $l
@lesm
lesm / web-fonts-asset-pipeline.md
Created April 18, 2017 02:35 — forked from anotheruiguy/web-fonts-asset-pipeline.md
Custom Web Fonts and the Rails Asset Pipeline

Web fonts are pretty much all the rage. Using a CDN for font libraries, like TypeKit or Google Fonts, will be a great solution for many projects. For others, this is not an option. Especially when you are creating a custom icon library for your project.

Rails and the asset pipeline are great tools, but Rails has yet to get caught up in the custom web font craze.

As with all things Rails, there is more then one way to skin this cat. There is the recommended way, and then there are the other ways.

The recommended way

Here I will show how to update your Rails project so that you can use the asset pipeline appropriately and resource your files using the common Rails convention.

= sanitize(text, :tags=>[]).truncate(30, :separator => " ").html_safe
= truncate(strip_tags(post.content), length: 100, omission: '...')
= raw @post.description
dataCatalogo = (catalogo) ->
$.getJSON(
url: 'catalogo'
global: false
async: false
data: {catalogo: catalogo}
success: (data) ->
return data
error: (data) ->
console.log 'error', data