Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Working from home

Mohamed Ziata WaKeMaTTa

💻
Working from home
View GitHub Profile
View Error when try log-in
Started POST "/sessions/new" for 127.0.0.1 at 2014-04-03 11:29:54 +0200
ActionController::RoutingError (No route matches [POST] "/sessions/new"):
actionpack (4.0.3) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.3) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.3) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.3) lib/active_support/tagged_logging.rb:25:in `tagged'
View line_item.rb
class LineItem < ActiveRecord::Base
belongs_to :order
belongs_to :product
validates :product_id, :quantity, presence: true
validates :quantity, numericality: { only_integer: true }
before_save :set_price_to_products
private
View gist:1af4ab8dd0d6da287750
http://plus.google.coms/hangouts/_/stream/ytl/sSPRzi9D_lU5zvh7_0jsjtb5x5T_uXXsNpZ5v-3kFDA=?hl=fr&authuser=0
View gist:ee0d9ca166703ee1a86d
https://plus.google.com/hangouts/_/ytl/sSPRzi9D_lX1WoXVxtDJp5fm0IB0NLBXy-hFehGfzAs=?hl=es_ES&authuser=0
@WaKeMaTTa
WaKeMaTTa / syntax-type-1.jsx
Created Jan 12, 2016
Which syntax is more better to use?
View syntax-type-1.jsx
class MoviesApp extends Component {
render() {
var initialRoute = {name: 'search'};
return (
<Navigator
style={styles.container}
initialRoute={initialRoute}
configureScene={() => Navigator.SceneConfigs.FadeAndroid}
renderScene={RouteMapper}
/>
View error.sh
Unable to download https://www.atom.io/api/packages/linter-plus-eslint/versions/0.4.0/tarball: 400 Bad Request Repository inaccessible
@WaKeMaTTa
WaKeMaTTa / bug_report_enum_and_paper_trail.rb
Last active May 16, 2016
Bug report : Enum and PaperTrail
View bug_report_enum_and_paper_trail.rb
# Issues https://github.com/airblade/paper_trail/issues/798
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
View capybara_cheat_sheet.md

Navigating

visit("/projects")
visit(post_comments_path(post))

Clicking links and buttons

@WaKeMaTTa
WaKeMaTTa / hash_serializer.rb
Created Jun 16, 2016
app/serializers/hash_serializer.rb
View hash_serializer.rb
# app/serializers/hash_serializer.rb
class HashSerializer
def self.dump(hash)
hash.to_json
end
def self.load(hash)
hash = ActiveSupport::JSON.decode(hash) if hash.is_a? String
(hash || {}).with_indifferent_access
end
You can’t perform that action at this time.