Skip to content

Instantly share code, notes, and snippets.

View vshvedov's full-sized avatar
💾
1.44MB

Vladyslav Shvedov vshvedov

💾
1.44MB
View GitHub Profile
<%= init_fb_connect('XFBML', :js => :jquery) %>
ruby -e'include Math;(-7..30).each{|y|s="";\
(26..100).each{|x|s<<" .,:+*%xX08@"[ \
((sin(x/8.0)+2+sin(y*x/2.0))** \
(sin(y/7.0)+1)*12/16.0)]};puts s}'
Haml::Template.options[:format] = :html5
class Object
def cdebug(tag=nil)
RAILS_DEFAULT_LOGGER.info "\n\033[1;33;44m#{tag}\033[1;32;40m#{self.class} \033[0;30;47m#{self.inspect}\033[0m"
end
def clog(tag=nil)
puts "\n\033[1;33;44m#{tag}\033[1;32;40m#{self.class} \033[0;30;47m#{self.inspect}\033[0m"
end
def prepare_dump(tag=nil)
@stack = []
@stack << "\n\033[1;33;44m#{tag}\033[1;32;44m #{self.class}\033[0m\n"
SomeApp::Application.routes.draw do
resources :resources
end
# View
<% form_for :spec do |form| %>
<fieldset>
<legend><span><%= future_i18t("What's your current marital status?") %></span></legend>
<div class="form-input">
<%= error_messages_for'spec' %>
<div class="radio_button_row">
<%= radio_button :spec, :p2_marital_status, 'p2_marital_single_never_married', :onclick =>"toggleOtherExplain;" %>
@vshvedov
vshvedov / gist:1000473
Created May 31, 2011 13:13
List of jQueryUI methods
draggable
droppable
resizable
selectable
sortable
accordion
autocomplete
button
datepicker
dialog
@vshvedov
vshvedov / id_net.rb
Created October 11, 2011 16:58
ID.NET OmniAuth Strategy
require 'omniauth/oauth'
require 'multi_json'
module OmniAuth
module Strategies
class IdNet < OmniAuth::Strategies::OAuth2
def initialize(app, api_key = nil, secret_key = nil, options = {}, &block)
client_options = {
:site => IDNET_PROVIDER_URL,
@vshvedov
vshvedov / boilerplate.css
Created October 25, 2011 16:47
CSS test
abbr[title] { border-bottom: 1px dotted; }
b, strong { font-weight: bold; }
blockquote { margin: 1em 40px; }
dfn { font-style: italic; }
hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; }
ins { background: #ff9; color: #000; text-decoration: none; }
mark { background: #ff0; color: #000; font-style: italic; font-weight: bold; }
pre, code, kbd, samp { font-family: monospace, monospace; _font-family: 'courier new', monospace; font-size: 1em; }
pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; }
q { quotes: none; }
@vshvedov
vshvedov / gist:1319641
Created October 27, 2011 14:09
ID.NET OmniAuth Strategy
require 'omniauth/oauth'
require 'multi_json'
module OmniAuth
module Strategies
class IdNet < OmniAuth::Strategies::OAuth2
def initialize(app, api_key = nil, secret_key = nil, options = {}, &block)
client_options = {
:site => IDNET_PROVIDER_URL,