Skip to content

Instantly share code, notes, and snippets.

View swazza's full-sized avatar

Swarup Karavadi swazza

  • Hyderabad, India
View GitHub Profile
@swazza
swazza / declarativeValidator.js
Last active August 29, 2015 14:00
cookbook: jQuery global validator
var declarativeValidator = function () {
var dictionary = {}; // dictionary of form names and their submitHandlers
var init = function () {
initForms();
}
var initForms = function () {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<div id="mount">
<button id="decrement">-</button>
@swazza
swazza / .js
Created May 9, 2017 12:22
Ridiculously Simple SAGA Coordinator
function bookCar() {
console.log('%c Starting Book Car Task', 'color: blue');
console.log('...');
console.log('...');
console.log('%c Car Booking Confirmed.', 'color: green');
console.log('%c Book Car Task done.', 'color: blue');
return true;
}
function bookHotel() {
@swazza
swazza / .js
Last active May 9, 2017 13:21
Redux Container vs Presentational
// Component5.js
const Component5 = ({ props: {foo5, bar5}}) => (
<div>
<span>{foo5}</span>
<span>{bar5}</span>
</div>
)
// Component4.js
const Component4 = ({ props: {foo4, bar4}}) => (
@swazza
swazza / .js
Created May 9, 2017 13:31
Redux colocate component & data
// Component5.js
const _Component5 = ({ props: {foo5, bar5}}) => (
<div>
<span>{foo5}</span>
<span>{bar5}</span>
</div>
)
const mapStateToProps = (state) => ({ foo5: state.foo5, bar5: state.bar5 })
export const Component5 = connect(mapStateToProps, null)(_Component5)
@swazza
swazza / .js
Created May 10, 2017 10:53
Pipeline Processor Using Reduce
function add(i) {
return i + 1;
}
function mul(i) {
return i * 2;
}
function sqr(i) {
return i * i;
@swazza
swazza / .js
Created May 11, 2017 01:39
Generators as Observables
function observable(observer) {
for(var i = 0; i <= 10; i++) {
observer.next(i)
}
observer.error()
observer.complete()
}
const observer = {
next(value) { console.log(`next -> ${value}`) },
@swazza
swazza / react-rmap.md
Last active June 28, 2017 11:01
Roadmap For React - Noob To Ninja

Basics

  • "Hello, World!" with create-react-app
  • React Component
  • Popular ES6+ features using in React Apps
    • Arrow Methods
    • Object Destructuring
    • Classes
    • Static fields
  • Communicating Between Components
  • Parent To Child using 'props'
<userGroupProvider>
<identifier>file-user-group-provider</identifier>
<class>org.apache.nifi.authorization.FileUserGroupProvider</class>
<property name="Users File">./auth-conf/users.xml</property>
<property name="Legacy Authorized Users File"></property>
<property name="Initial User Identity 0">{adminemail}</property>
<property name="Initial User Identity 3">CN=nifi-2.nifi-hs.nifi.svc.cluster.local, OU=NIFI</property>
<property name="Initial User Identity 2">CN=nifi-1.nifi-hs.nifi.svc.cluster.local, OU=NIFI</property>
<property name="Initial User Identity 1">CN=nifi-0.nifi-hs.nifi.svc.cluster.local, OU=NIFI</property>
</userGroupProvider>