Skip to content

Instantly share code, notes, and snippets.

View Lazhari's full-sized avatar
:octocat:
Working from home

Lazhari Lazhari

:octocat:
Working from home
View GitHub Profile
@chantastic
chantastic / on-jsx.markdown
Last active November 10, 2024 13:39
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@Lazhari
Lazhari / readme.md
Created November 18, 2015 12:02
Use Bitbucket repo with openshift
  1. Clone your repository
$ git clone <bitbucket-repo-url>
  1. Add the remote origin for openshift

Your local clone has then your other repo (bitbucket etc.) as remote repo. Your remote repo is stored with the alias "origin" (the default alias used by git if you clone). You then add the openshift repo as remote to your clone. You do that while explicitly using an alias for the remote repo you add - I'm using "openshift" as alias here:

@jacobkahn
jacobkahn / .flowconfig
Created August 24, 2016 04:30
Flow Config that works with Create React App and Nuclide
[libs]
./node_modules/fbjs/flow/lib
[options]
esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable
module.name_mapper='^\(.*\)\.css$' -> 'react-scripts/config/flow/css'
module.name_mapper='^\(.*\)\.\(jpg\|png\|gif\|eot\|otf\|webp\|svg\|ttf\|woff\|woff2\|mp4\|webm\)$' -> 'react-scripts/config/flow/file'
@JaniKibichi
JaniKibichi / app.js
Created October 2, 2016 10:34
Sample code about uploading pictures to cloudinary using multer - NodeJs ExpressJS Framework
'use strict';
var express = require("express");
var multer = require('multer');
var app = express();
var options = require('./config/config')
var mongoose = require('mongoose');
/* photo manenos */
var cloudinary = require('cloudinary');
@jaredpalmer
jaredpalmer / EmailInput.jsx
Created November 29, 2017 18:06
Formik async email signup input
import React from 'react';
import debounce from 'utils/debounce';
class EmailInput extends React.Component {
checkEmail = value => {
// only check if the field passes Yup email validation first
if (
!this.props.form.errors[this.props.name].includes(
'invalid' /* or whatever your error message is*/
)