Skip to content

Instantly share code, notes, and snippets.

module Rack
# A rack middleware for validating HTML via w3c validator
class Validate
def initialize( app )
@app = app
end
def call( env )
#!/bin/bash
sudo apt-get update
# Install Basics
# build-essential needed for "make" command
sudo apt-get install -y build-essential software-properties-common \
vim curl wget tmux
# Install PHP 5.6
sudo add-apt-repository -y ppa:ondrej/php5-5.6
@bogdanRada
bogdanRada / event.rb
Last active August 29, 2015 14:27 — forked from AstDerek/event.rb
Simple Rails app compatible with DHTMLX Scheduler http://www.dhtmlx.com/docs/products/dhtmlxScheduler/index.shtml
class Event < ActiveRecord::Base
attr_accessible :_timed, :details, :end_date, :start_date, :text
# From http://www.dhtmlx.com/docs/products/dhtmlxScheduler/xml/events.xml
def to_xml (options = {})
options[:indent] ||= 2
xml = options[:builder] ||= Builder::XmlMarkup.new(:indent => options[:indent])
xml.instruct! unless options[:skip_instruct]
xml.event(:id => id, :timed => _timed) do
xml.text text
@bogdanRada
bogdanRada / rack_spellcheck.rb
Last active August 31, 2015 09:30 — forked from techiferous/gist:235097
rack_spellcheck.rb
# If you'd like this packaged up as a gem, send me a note. You can get
# in touch with me at http://www.techiferous.com/about
require 'nokogiri'
require 'ispell'
module Rack
class SpellCheck
def initialize(app, options = {})
@bogdanRada
bogdanRada / Gemfile
Last active August 31, 2015 09:32 — forked from gorenje/Gemfile
source :rubygems
gem 'sinatra'
gem 'json'
gem 'omniauth'
gem 'omniauth-oauth2'
gem 'omniauth-github'
gem 'omniauth-facebook'
gem 'omniauth-twitter'
# gem 'omniauth-att', :path => File.expand_path("./../../omniauth-att", __FILE__)
@bogdanRada
bogdanRada / ubuntu_enable_workspaces.sh
Last active August 31, 2015 09:34
enable workspaces ubuntu
enable workspaces
gsettings set org.compiz.core:/org/compiz/profiles/unity/plugins/core/ hsize 2
@bogdanRada
bogdanRada / actor.rb
Last active August 31, 2015 09:38 — forked from darkhelmet/actor.rb
LolConcurrency::Actor Make Your own Celluloid
require 'forwardable'
require 'thread'
require 'monitor'
module LolConcurrency
module Actor
Context = Struct.new(:method, :args, :block)
Async = Struct.new(:instance, :mailbox) do
extend Forwardable
@bogdanRada
bogdanRada / olark_livecha_glass_theme.css
Last active August 31, 2015 09:43 — forked from stringtheory/azul_theme.css
Custom Theme Examples from Olark - non-minified.
#habla_window_div button, #habla_window_div input[type=submit] {
width: auto;
font-size: 14px;
margin: 5px 3px 0 5px!important;
}
#habla_window_div [class*=span] {
float: none;
margin-left: 0;
}
#habla_beta_container_do_not_rely_on_div_classes_or_names .habla_window_div_base {
@bogdanRada
bogdanRada / zopim_livechat_mixpanel_tracking.js
Last active August 31, 2015 09:46 — forked from fotoflo/gist:10934777
zopim mixpanel tracking.js
//
// Track.js - tracking scripts by alex miller
//
//
config = {};
config.track = true;// set to true in production, false in dev env
config.dump = true;// set to false in production env, true in dev
config.mixpanel = true; // <%= TRACKS_CONFIG['mixpanel'] %>; // set to true in production env, false in dev
config.googleAnaltyics = true;
@bogdanRada
bogdanRada / Gemfile
Last active August 31, 2015 09:52 — forked from ahaedike/Gemfile
websockets - chat example in HTML template
source "https://rubygems.org"
gem 'eventmachine'
gem 'rubysl-stringio'
gem 'sinatra'
gem 'yajl-ruby', require: 'yajl'
gem 'thin'
gem 'em-websocket', :git=>'https://github.com/igrigorik/em-websocket.git'