Skip to content

Instantly share code, notes, and snippets.

View kmelkon's full-sized avatar
👨‍💻

Karam Malkon kmelkon

👨‍💻
View GitHub Profile
@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
@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({
@wojteklu
wojteklu / clean_code.md
Last active November 20, 2024 06:28
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

@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

@gokulkrishh
gokulkrishh / media-query.css
Last active November 10, 2024 02:00
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@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

@srcspider
srcspider / ubuntu.conf.md
Last active October 20, 2018 20:10
Basic Ubuntu Web Dev Essentials

Editor

Recommended Editor:

From here on we'll use edit to denote the command that's meant to open the file in the editor. Replace edit with subl or atom as needed.

@JoeKeikun
JoeKeikun / input_cursor_color
Last active June 7, 2022 12:08
How to change <input> input cursor color by css (webkit)
When I developed an app for ios by phonegap, I had a trouble in changing the <input> input cursor color.
but now, there is a solution for it:
---------------
<style>
input {
color: rgb(60, 0, 248); /* change [input cursor color] by this*/
text-shadow: 0px 0px 0px #D60B0B; /* change [input font] by this*/
-webkit-text-fill-color: transparent;
@seankross
seankross / init.md
Created February 5, 2014 18:26
Initializing GitHub repository

Create a new repository on the command line

touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/seankross/womp.git
git push -u origin master
@cythux
cythux / Polymer-Slider.markdown
Created November 11, 2013 15:44
A Pen by Rob Dodson.