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 / PHP Configuration Compile param
Last active December 25, 2015 05:49 — forked from JeffreyWay/gist:3185773
PHP Configuration Compile param
./configure \
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--sysconfdir=/private/etc \
--with-apxs2=/usr/sbin/apxs \
--enable-cli \
--with-config-file-path=/etc \
--with-libxml-dir=/usr \
--with-openssl=/usr \
# Colorful Bash Prompt, inspired by "Extravagant Zsh Prompt"
# Screenshot: http://img.gf3.ca/d54942f474256ec26a49893681c49b5a.png
# A big thanks to \amethyst on Freenode
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then export TERM=gnome-256color
elif infocmp xterm-256color >/dev/null 2>&1; then export TERM=xterm-256color
fi
if tput setaf 1 &> /dev/null; then
tput sgr0
@garmjs
garmjs / 0_reuse_code.js
Created January 24, 2014 00:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@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 / 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
@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 / 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 / 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 / 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 / useMeasure.js
Created July 3, 2019 11:41 — forked from stolinski/useMeasure.js
useMeasure - taken from React Spring example
import { useRef, useState, useEffect } from 'react'
import ResizeObserver from 'resize-observer-polyfill'
export default function useMeasure() {
const ref = useRef()
const [bounds, set] = useState({ left: 0, top: 0, width: 0, height: 0 })
const [ro] = useState(() => new ResizeObserver(([entry]) => set(entry.contentRect)))
useEffect(() => (ro.observe(ref.current), ro.disconnect), [])
return [{ ref }, bounds]
}