Skip to content

Instantly share code, notes, and snippets.

View caseol's full-sized avatar

Carlos André Oliveira caseol

View GitHub Profile
@crittermike
crittermike / wget.sh
Last active March 26, 2024 22:49
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
@ryderstorm
ryderstorm / installing_rmagick_ubuntu_16.04.txt
Last active May 17, 2023 00:28
Installing rmagick gem on Ubuntu 16.04
# the instructions from here: https://stackoverflow.com/questions/3704919/installing-rmagick-on-ubuntu/31089915#31089915
# worked, but only after I added in line 8
sudo apt-get purge graphicsmagick graphicsmagick-dbg imagemagick-common imagemagick imagemagick-6.q16 libmagickcore-6-headers libmagickwand-dev graphicsmagick-libmagick-dev-compat
sudo apt-get autoremove
sudo apt-get install imagemagick libmagickwand-dev
sudo ln -s /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/Magick-config /usr/bin/Magick-config
export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig
gem install rmagick
@vinicius-stutz
vinicius-stutz / README.md
Last active May 8, 2024 19:19
Máscara p/ telefones com 8 ou 9 dígitos (jquery.mask.js)
@ludviglindblom
ludviglindblom / dabblet.css
Created December 21, 2011 07:52 — forked from maxhoffmann/dabblet.css
CSS3 Border-Radius with Border - Circle Avatars
/**
* CSS3 Border-Radius with Border - Circle Avatars
*/
/* General Styles */
body { background: url(http://subtlepatterns.com/patterns/white_texture.png);
font: 100 14px sans-serif;
color: #444555; text-shadow: 0 2px white;
text-align: center;
@cmilfont
cmilfont / user.rb
Created December 4, 2011 19:46
Thumbnail com crop circular
validates_attachment_presence :avatar
validates_attachment_content_type :avatar, :content_type => ["image/png", "image/jpeg", "image/jpg"]
validates_attachment_size :avatar, :less_than => 10.megabytes
has_attached_file :avatar,
:styles => {
:medium => "446x310>",
#importante definir png como formato do thumb senão ele não aplica o crop se for jpg
:thumb => ["100x105#", :png],
:dashboard => "150X200>" },
:convert_options => {
@walterdavis
walterdavis / gist:1301612
Created October 20, 2011 16:37
Convert MP3 to OGG during upload using Paperclip
module Paperclip
# Converts ogg audio for Firefox
class Ogg < Processor
attr_accessor :whiny
# Creates an Ogg from MP3
def make
src = @file
dst = Tempfile.new([@basename, '.ogg'])