Skip to content

Instantly share code, notes, and snippets.

View pratik14's full-sized avatar

Pratik Shah pratik14

View GitHub Profile
pratik14 / App.js
Created September 17, 2019 03:38
Testing react Formik forms with react-testing-library
import React from "react";
import { Formik, Form, Field, ErrorMessage } from "formik";
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
const App = () => (
initialValues={{ email: "", date: "" }}
pratik14 / app.js
Created October 31, 2017 11:08
SImple React Redux Notification. Single notification at a time
import React, { PureComponent } from 'react';
import NotificationContainer from './../../containers/notificationContainer';
class App extends PureComponent {
render() {
return (
<NotificationContainer />
.directive('restrict', [function(){
restrict: 'A',
prioriry: 100000,
scope: false,
link: function(scope, element, attr) {
var accessDenied = true;
var role_code = scope.user.role_code;
<!DOCTYPE html>
<html lang="en">
<script src=""></script>
<body ng-app="myapp">
pratik14 / Device Trace for "undefined method `to_key' for :user:Symbol"
Created July 26, 2011 13:22 — forked from mdlima/Device Trace for "undefined method `to_key' for :user:Symbol"
This is the full trace for the "undefined method `to_key' for :user:Symbol", as written by rspec -v.
Failure/Error: post :create, :user => @attr
undefined method `to_key' for :user:Symbol
# /Users/mdlima/.rvm/gems/ruby-1.8.7-p334@rails3/gems/devise-1.2.1/lib/devise/rails/warden_compat.rb:18:in `serialize'
# /Users/mdlima/.rvm/gems/ruby-1.8.7-p334@rails3/gems/warden-1.0.3/lib/warden/session_serializer.rb:25:in `store'
# /Users/mdlima/.rvm/gems/ruby-1.8.7-p334@rails3/gems/warden-1.0.3/lib/warden/proxy.rb:161:in `set_user'
# /Users/mdlima/.rvm/gems/ruby-1.8.7-p334@rails3/gems/devise-1.2.1/lib/devise/controllers/helpers.rb:116:in `sign_in'
# ./app/controllers/sessions_controller.rb:8:in `create'
# /Users/mdlima/.rvm/gems/ruby-1.8.7-p334@rails3/gems/actionpack-3.0.5/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
# /Users/mdlima/.rvm/gems/ruby-1.8.7-p334@rails3/gems/actionpack-3.0.5/lib/action_controller/metal/implicit_render.rb:4:in `send_action'