Skip to content

Instantly share code, notes, and snippets.

View ognevsky's full-sized avatar

Andrey Ognevsky ognevsky

View GitHub Profile
# 1) Point *.example.com in your DNS setup to your server.
#
# 2) Setup an Apache vhost to catch the star pointer:
#
# <VirtualHost *:80>
# ServerName example.com
# ServerAlias *.example.com
# </VirtualHost>
#
# 3) Set the current account from the subdomain
@xiaods
xiaods / gist:337218
Created March 19, 2010 04:06 — forked from gerhard/etc_default_php-fastcgi
REE + nginx + Passenger + MySQL + mysql gem + git on Ubuntu 9.10 Karmic
# inspiration
# http://github.com/jnstq/rails-nginx-passenger-ubuntu
# sudo this sudo that bollocks
sudo -i
# system-related stuff
apt-get install htop strace sysstat
dpkg-reconfigure sysstat
apt-get install ntp
@akzhan
akzhan / access.theme.rb
Created October 19, 2010 09:21
How to use hash as getters and setters
class PropertyHash < Hash
def method_missing(name, *args, &block)
return self[name.to_s] if include?(name.to_s) && args.size == 0
return !!self[$1] if name.to_s =~ /^(.+)\?$/ && include?($1) && args.size == 0
if name.to_s =~ /^(.+)\=$/ && include?($1) && args.size == 1
self[$1] = args.first
return
end
super
end
@martinisoft
martinisoft / tpl-cukeapp.rb
Created October 24, 2010 04:35
Rails 3, RSpec, Cucumber, Factory_Girl, HAML, SASS, Devise, Formtastic Template
## Rails App Template
## Updated for Rails 3.0.1
## Created on 10/23/10
## Updated on 11/4/10
## Run using $ rails new [appname] -JT -m tpl-cukeapp.rb
## Gems
# Warden and Devise for security
gem 'warden', '0.10.7'
@duonoid
duonoid / gist:807008
Created February 2, 2011 00:20
after gem update 2011-02-01 (most likely: rubygems-update-1.4.2 -> 1.5.0)
$ ./script/server
=> Booting Mongrel
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:in `requirement': undefined local variable or method `version_requirements' for #<Rails::GemDependency:0xf6e64a78> (NameError)
from /usr/local/lib/site_ruby/1.8/rubygems.rb:254:in `activate'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:1204:in `gem'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:73:in `add_load_paths'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:301:in `add_gem_load_paths'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:301:in `each'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:301:in `add_gem_load_paths'
@julik
julik / unfuck_osx_readline_for_ruby.txt
Created August 24, 2011 13:10
Decent Readline support for irb/pry on Leopard and above for decent UTF8 input, with RVM
Ensure that your ~/.inputrc contains this
set convert-meta off
set input-meta on
set output-meta on
Install the REAL GNU readline from source
$ curl ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz | tar xfz - && cd readline-6.2 && ./configure --enable-multibyte && make && sudo make install
@bglusman
bglusman / hashinit.rb
Created January 11, 2012 14:23
HashInit
module HashInit
#example usage:
# instead of this -
#
# class Message
# attr_reader :content, :sender, :subject
# attr_accessor :event
# def initialize(message)
@sj26
sj26 / 0-readme.md
Created May 5, 2012 05:39 — forked from burke/0-readme.md
ruby-1.9.3-p194 cumulative performance patch.

Patched ruby 1.9.3-p194 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p194 with patches for boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Huge thanks to funny-falcon for the performance patches.

@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

React is the new Lego - how we deal with a lot of components

Lightning talk proposal for ReactiveConf 2016

BlueKit usage

At Blueberry, we've been frustrated with maintaining and getting oriented in our React components and their props. That's why we made a tool for automatically generating a component library from a project's components.

We named it BlueKit and released it as open-source.