Skip to content

Instantly share code, notes, and snippets.

@ccamacho
ccamacho / howto.md
Created September 9, 2018 11:58 — forked from vranystepan/howto.md
Getting Thumbnails / Previews of your RAW files in Fedora 25

Howto

Install these programms

sudo dnf install raw-thumbnailer
sudo dnf install ufraw

Try now if everything works, and your thumbnails show up. If not, try the following part.

@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active July 2, 2024 11:24
crack activate Office on mac with license file
@WeiChiaChang
WeiChiaChang / progress.html
Created July 26, 2017 10:08
Simple Pure CSS Progress Bar
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta chatset="UTF-8" />
<title>CSS Progress Bar</title>
<style>
.wrapper {
width: 500px;
}
@milanaryal
milanaryal / schema-org-structured-data-markup-using-microdata.html
Last active November 4, 2023 13:45
An example of how to mark up a HTML5 webpage using the schema.org schemas and microdata.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Site Title</title>
<link rel="stylesheet" href="/assets/css/style.min.css">
@traviskroberts
traviskroberts / gist:2830535
Created May 29, 2012 20:33
FactoryGirl Polymorphic Association
class Alert < ActiveRecord::Base
belongs_to :alertable, :polymorphic => true
end
class Region < ActiveRecord::Base
has_many :alerts, :as => :alertable
end
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
@jrochkind
jrochkind / gist:2161449
Created March 22, 2012 18:40
A Capistrano Rails Guide

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

@krishicks
krishicks / gist:1073563
Created July 9, 2011 12:52
Double-polymorphic has_many through modeling in Rails
class Article < ActiveRecord::Base
has_many :content_relationships, as: :origin, dependent: :destroy
has_many :related_articles, through: :content_relationships, source: :related_content, source_type: "Article"
has_many :related_videos, through: :content_relationships, source: :related_content, source_type: "Video"
end
class Video < ActiveRecord::Base
has_many :content_relationships, as: :origin, dependent: :destroy
@karmi
karmi / workers.rake
Created July 22, 2010 15:58
Rake taks to launch multiple Resque workers in development/production with simple management included
# Rake task to launch multiple Resque workers in development/production with simple management included
require 'resque/tasks' # Require Resque tasks
namespace :workers do
# = $ rake workers:start
#
# Launch multiple Resque workers with the Rails environment loaded,
# so they have access to your models, etc.