Skip to content

Instantly share code, notes, and snippets.

View ottodranik's full-sized avatar

Y.Shepard ottodranik

View GitHub Profile
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Pure html by Shepard</title>
<meta name="description" content="Site of pure html">
<meta name="keywords" content="HTML, site, pure, kottans">
<meta name="author" content="Shepard">
</head>
<body>
require 'bundler/capistrano'
set :application, "net"
set :repository, "git@githost.com:net.git"
set :scm, :git
set :default_environment, {
'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"
}
require 'sinatra'
require 'action_mailer'
class Mailer < ActionMailer::Base
def contact
mail(
:to => "test@example.com",
:from => "test@example.com",
:subject => "Test") do |format|
format.text
# Rake task for compiling CoffeeScript and SASS (Compass).
#
# Author: Kim Burgestrand <http://burgestrand.se/>
# Date: 6th October 2010
# License: X11 License (MIT License)
# URL: http://gist.github.com/gists/613114
desc "Compiles CoffeeScript using Barrista (but only if they changed)"
task 'coffee:compile' => :environment do
require 'barista'
abort "'#{Barista::Compiler.bin_path}' is unavailable." unless Barista::Compiler.available?
@ottodranik
ottodranik / Example: Presenter in Rails.rb
Last active August 29, 2015 14:10
This is how add and use presenters in Rails
class ProjectPresenter
NUMBER_OF_ACTIVITIES = 4
attr_reader :template
def initialize(project, template)
@project = project
@template = template
end
def show_categories
template.render partial: "category",
@ottodranik
ottodranik / admin-product.rb
Last active February 6, 2017 09:51
Example: Use Acts-As-Taggable-On gem with Active-Admin and rails observers
ActiveAdmin.register Product do
permit_params :name, :category_id, :description, :text, :slug, :in_slider, :tag_ids => []
filter :category
filter :base_tags
filter :name
filter :text
filter :created_at
filter :updated_at
@ottodranik
ottodranik / Gemfile
Last active August 29, 2015 14:12 — forked from datenimperator/Gemfile
Sinatra, sprockets, compass, bootstrap-sass playing together
source :rubygems
gem 'shotgun', :group=>:development
gem 'rack-cache'
gem 'sinatra', :require => 'sinatra/base'
gem 'sinatra-support'
gem 'haml'
@ottodranik
ottodranik / app.rb
Last active August 29, 2015 14:12 — forked from shamrt/Gemfile
Padrino/Sinatra + AssetPack + Compass settings
module Profile
class App < Padrino::Application
set :root, File.dirname(__FILE__) # Must be set
register Padrino::Rendering
register Padrino::Helpers
enable :sessions
@ottodranik
ottodranik / gist:caf0f722654ad3e872b1
Created January 19, 2016 09:18
uiGmapGoogleMapApiProvider configure
uiGmapGoogleMapApiProvider.configure({
client : 'our-companys-key',
v: '3.17',
libraries: 'weather,geometry,visualization'
key: 'YOUR_API_KEY'
transport: 'http'
isGoogleMapsForWork: true
});
@ottodranik
ottodranik / ultimate-ut-cheat-sheet.md
Created September 8, 2017 11:26 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies