Skip to content

Instantly share code, notes, and snippets.


José Luis SalahAdDin

View GitHub Profile
View useTracking.ts
import {useEffect, useState} from 'react';
import {Alert} from 'react-native';
import BackgroundGeolocation from '@mauron85/react-native-background-geolocation';
import {defaultLocation} from '../utils/vars';
import {getDistanceFromLatLonInKm} from '../utils/getDistance';
const useTracking = (isActive: boolean) => {
const [location, setLocation] = useState(defaultLocation);
const [history, setHistory] = useState<any>([]);
const [distance, setDistance] = useState<number>(0);
obrodinho /
Created Feb 12, 2019
[Arch] Install TTF Fonts from Windows 10

Micro Intro

Arch is great and its wiki covers most use cases. This is just a reminder that what works and which newbie tricks are required to get and install these fonts.


Fastest way, but NOT VERIFIED This package holds all files nedded to install win10 ms fonts. These are just the pacman-cache-install-ready-sort-of-a-files. They are in the form of: ttf-ms-win10-10.0.17763.1-1-any.pkg.tar.xz, and they are the result of a succesful makepkg

luciddreamz /
Last active Aug 29, 2022 — forked from paoloantinori/
Keycloak Admin API Rest Example: Get User
# requires
# config
ThomasG77 /
Last active Oct 28, 2021
5 minutes PgAdmin4 Desktop install guide

5 minutes PgAdmin4 Desktop install guide

Done on Linux (Ubuntu tested)

Virtualenv & install of Python package & its deps

cd $HOME
virtualenv --python=/usr/bin/python2.7 pgadmin4
source pgadmin4/bin/activate
parmentf /
Last active Sep 29, 2022
Git Commit message Emoji
barreyro / Coin Determiner
Created May 23, 2015
Have the function CoinDeterminer(num) take the input, which will be an integer ranging from 1 to 250, and return an integer output that will specify the least number of coins, that when added, equal the input integer. Coins are based on a system as follows: there are coins representing the integers 1, 5, 7, 9, and 11. So for example: if num is 1…
View Coin Determiner
def CoinDeterminer(num)
return num if num < 5
count = num / 11
if (num%11).even?
return count + 2
return count + 1
bgrace / gist:a5216b4059007924a75c
Last active Feb 16, 2018
Mixed navigation menus for Wagtail CMS
View gist:a5216b4059007924a75c
# Notes:
# Python 3 assumed, but shouldn't be hard to backport to Python 2
# Cobbled together from two slightly different implementations, sorry for any inconsistencies.
# This creates two models, NavigationMenu, and NavigationMenuItem. A site can have many NavigationMenus, which are referenced from
# the template by location. E.g., 'footer', 'left_nav'. You can also create single-item lists for special purpose links/buttons,
# such a privacy_policy or homepage_cta. This helps to reduce hard coding in templates.
# NavigationMenuItem mixes in some different link types (Page, Document, URL) and presents them in a consistent way. It provides
# the ability to override the title of the referenced object.
soarez /
Last active Sep 21, 2022
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.