Skip to content

Instantly share code, notes, and snippets.

View galetahub's full-sized avatar

Igor Galeta galetahub

View GitHub Profile
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active June 14, 2024 11:43
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@superp
superp / gist:1523718
Created December 27, 2011 13:52
Sunrise CRM scaffold template
gem("mysql2")
gem("devise")
gem("sunrise-cms", :path => '/var/www/gems/cms/sunrise')
gem("therubyracer", :group => 'development')
gem("mongrel", :version => "1.2.0.pre2", :group => 'development')
gem("rspec-rails", :version => "~> 2.7.0", :group => 'test')
gem("database_cleaner", :version => "~> 0.7.0", :group => 'test')
gem("factory_girl_rails", :version => "~> 1.4.0", :group => 'test')
gem("fuubar", :group => 'test')
@evo42
evo42 / aloha-config.js
Created December 8, 2011 19:52
Aloha Editor -- send content via ajax to a backend php script to save the data edited with Aloha Editor
( function ( window, undefined ) {
var Aloha = window.Aloha || ( window.Aloha = {} );
Aloha.settings = {
logLevels: { 'error': true, 'warn': true, 'info': true, 'debug': false, 'deprecated': true },
errorhandling: false,
ribbon: false,
locale: 'en',
floatingmenu: {
width: 630,
@ariera
ariera / README.markdown
Created August 7, 2011 16:23
Nestable, sortable and dragable categories

Nestable, sortable and dragable categories:

In the project I'm working on we wanted to have a Category model which we wanted to be nestable. But we also liked the user to have a draggable interface to manage and rearrange the order of his categories. So we chose awesome_nested_set for the model and jQuery.nestedSortable for the UI.

It took me some time to arrange things to work properly so I wanted to share my work in case it helps anybody.

Before beginning

you might want to take a look at a demo app

  1. go to: http://awesomenestedsortable.heroku.com/groups/
  2. click in show of any group