Skip to content

Instantly share code, notes, and snippets.

View sammndhr's full-sized avatar

Sam M. Manandhar sammndhr

View GitHub Profile
@gaearon
gaearon / MyResponsiveComponent.js
Created November 1, 2018 10:05
Examples from "Making Sense of React Hooks"
function MyResponsiveComponent() {
const width = useWindowWidth(); // Our custom Hook
return (
<p>Window width is {width}</p>
);
}
@mxstbr
mxstbr / Readme.md
Last active August 20, 2024 12:43
Enable tab completion for JSX with Emmet in Atom

Enable tab completion for JSX with Emmet in Atom

This guide assumes you have the emmet and language-babel packages already installed in Atom

Gif of the tab completion working

  1. Open the keymap.cson file by clicking on Atom -> Keymap… in the menu bar
  2. Add these lines of code to your keymap:
'atom-text-editor[data-grammar~="jsx"]:not([mini])':
@vaibhavtolia
vaibhavtolia / quicksort.js
Last active August 30, 2016 11:51
Quick-Sort in javascript
function quickSort(a, low, high){
if(high > low){
var index = getRandomInt(low,high);
//console.log(low,high,index);
var pivot = a[index];
//console.log("pivot",pivot);
a = partition(a,pivot);
//console.log(a);
quickSort(a,low,index-1);
@gre
gre / easing.js
Last active September 9, 2024 03:53
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {