Skip to content

Instantly share code, notes, and snippets.

View garmjs's full-sized avatar
🏍️
Lover

Armend Gashi garmjs

🏍️
Lover
  • Prishtine
View GitHub Profile
@garmjs
garmjs / helpers.js
Created November 12, 2017 22:25
AST Helpers
function findParent(node, test) {
if (test(node)) {
return node
} else if (node.parent) {
return findParent(node.parent, test)
}
return null
}
function looksLike(a, b) {
@garmjs
garmjs / util-elastic-collision.js
Created October 12, 2017 17:40 — forked from christopher4lis/util-elastic-collision.js
A set of utility functions used to reproduce the effect of elastic collision within HTML5 canvas.
/**
* Rotates coordinate system for velocities
*
* Takes velocities and alters them as if the coordinate system they're on was rotated
*
* @param Object | velocity | The velocity of an individual particle
* @param Float | angle | The angle of collision between two objects in radians
* @return Object | The altered x and y velocities after the coordinate system has been rotated
*/
@garmjs
garmjs / IntroductionToFlow.md
Created October 9, 2017 02:29 — forked from busypeoples/IntroductionToFlow.md
Introduction To Flow

Introduction To Flow

Intended for developers interested in getting started with Flow. At the end of this introduction, you should have a solid understanding of Flow and how to apply it when building an application.

Covers all the basics needed to get started with Flow.

Covers all the basic needed to get started with Flow and ReactJS.

@garmjs
garmjs / FlowTutorial.js
Created October 2, 2017 20:48 — forked from busypeoples/FlowTutorial.js
Flow Fundamentals For JavaScript Developers
// @flow
// Flow Fundamentals For JavaScript Developers
/*
Tutorial for JavaScript Developers wanting to get started with FlowType.
Thorough walkthrough of all the basic features.
We will go through the basic features to gain a better understanding of the fundamentals.
You can uncomment the features one by one and work through this tutorial.
@garmjs
garmjs / tmux-cheatsheet.markdown
Created March 30, 2017 16:32 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@garmjs
garmjs / server.js
Last active July 29, 2022 17:16
Simple SSR React, React Router v4 and Helmet with express
require('babel-register')
const express = require('express')
const React = require('react')
const ReactDOMServer = require('react-dom/server')
const ReactRouter = require('react-router')
const ServerRouter = ReactRouter.ServerRouter
const App = require('./src/App').default
const path = require('path')
const Helmet = require('react-helmet')
const compression = require('compression')
@garmjs
garmjs / ReactRouterv4 CodeSpliting.js
Last active July 31, 2017 12:37 — forked from acdlite/app.js
Quick and dirty code splitting with React Router v4
import React from 'react'
import { Loading } from '../components/loading'
function asyncComponent (getComponent) {
return class AsyncComponent extends React.Component {
static Component = null
mounted = false
state = {
Component: AsyncComponent.Component
.DS_Store
bower_components/
# Sass
.sass-cache/
*.css.map
# Logs
logs
*.log
npm-debug.log*
@garmjs
garmjs / introrx.md
Created January 23, 2016 03:33 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@garmjs
garmjs / React Filter List.js
Created November 18, 2015 19:54
React Filter
var updatedList = this.state.list.filter(function(item){
return item.toLowerCase().search(
evt.target.value.toLowerCase()) !== -1;
});
this.setState({ list: updatedList });