Skip to content

Instantly share code, notes, and snippets.

@lesm
lesm / digital_ocean_setup.md
Created January 19, 2018 18:25 — forked from ChuckJHardy/digital_ocean_setup.md
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions
@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.

@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
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,
@lesm
lesm / mysql.md
Last active January 7, 2016 22:23 — forked from nihilismus/mysql.md

/etc/rc.d/rc.mysqld-instancia1

#!/bin/sh

# Depende del usuario bajo el cual se ha de ejecutar el demonio
USER_DB=mysql

# Los directorios y archivos deben permitir a $USER_DB el acceso a lectura y escritura
DATADIR_DB=/home/mysql/instancia1