Skip to content

Instantly share code, notes, and snippets.

View kmelkon's full-sized avatar
👨‍💻

Karam Malkon kmelkon

👨‍💻
View GitHub Profile
@chantastic
chantastic / on-jsx.markdown
Last active May 13, 2025 12:04
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

@gokulkrishh
gokulkrishh / media-query.css
Last active May 7, 2025 06:24
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@kmelkon
kmelkon / Contract Killer 3.md
Created March 4, 2016 19:11
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: October 8th 2015
  • Original post

@wojteklu
wojteklu / clean_code.md
Last active May 17, 2025 14:58
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@franklinjavier
franklinjavier / api.js
Created March 8, 2018 05:03
api abstraction with axios
import axios from 'axios'
import { shim } from 'promise.prototype.finally'
import locale from 'constants/locale'
import { is } from 'utils'
import { slugify } from 'utils/string'
import { translateNotification } from 'utils/response'
shim()
const axiosInstance = axios.create({
@Spyna
Spyna / usePushNotification.js
Last active November 14, 2024 12:14
React custom Hook to handle push notification
import { useState, useEffect } from "react";
import http from "./utils/http";
//the function to call the push server: https://github.com/Spyna/push-notification-demo/blob/master/front-end-react/src/utils/http.js
import {
isPushNotificationSupported,
askUserPermission,
registerServiceWorker,
createNotificationSubscription,
getUserSubscription