Skip to content

Instantly share code, notes, and snippets.

View dspinellis's full-sized avatar

Diomidis Spinellis dspinellis

View GitHub Profile
@johnjreiser
johnjreiser / AmazonLinux-InstallPostGIS.sh
Last active April 29, 2024 14:55
Script to install PostgreSQL 13 and PostGIS 3.2 on fresh Amazon Linux 2
#!/bin/bash
# Script to install PostgreSQL and PostGIS on a fresh Amazon Linux instance
# Installing from source:
# - GEOS
# GEOS 3.10+ requires CMake 3+, not readily available on Amazon Linux 2.
GEOSVER=3.9.2
GEOSURL=http://download.osgeo.org/geos/geos-${GEOSVER}.tar.bz2
# - PROJ (GDAL requires 6+; 6.2.1 is the last to use SQLite 3.7; 6.2 had build issues, so 6.1.1)
@wouterds
wouterds / useAppState.ts
Created February 22, 2020 17:09
React Native useAppState hook
import { useState, useEffect, useCallback } from 'react';
import { AppState, AppStateStatus } from 'react-native';
const useAppState = () => {
const [appState, setAppState] = useState(AppState.currentState);
const handleAppStateChange = useCallback(
(nextAppState: AppStateStatus) => {
setAppState(nextAppState);
},
[setAppState],
@mjyc
mjyc / gise.sh
Last active April 4, 2020 20:52
Search & edit git-issue in terminal
vim $(grep -lR "$(sk --ansi -i -c 'grep -lER "{}" .issues/issues/ | grep -v tags | grep -v comments | xargs head -q -n 1')" .issues/issues/)
@chrisma
chrisma / bibtex_from_doi.sh
Last active April 20, 2020 15:29
Get BibTeX entry from doi.org
wget -qO- --header="Accept: application/x-bibtex" "https://doi.org/10.1109/5.771073"
@cventour
cventour / covid19gr-stats.sh
Last active February 23, 2022 12:43
Extract covid19.gov.gr infections stats (whole history)
#!/bin/sh
curl https://covid19.innews.gr | gunzip > covid.html
cat covid.html | grep daily_stats | cut -d "=" -f2 | sed 's/^.//;s/.$//' > daily_stats.json
cat covid.html | grep weekly_stats | cut -d "=" -f2 | sed 's/^.//;s/.$//' > weekly_stats.json
cat covid.html | grep three_days_stats | cut -d "=" -f2 | sed 's/^.//;s/.$//' > three_days_stats.json
cat covid.html | grep last_stats | cut -d "=" -f2 | sed 's/^.//;s/.$//' > today_stats.json
cat covid.html | grep total_stats | cut -d "=" -f2 | sed 's/^.//;s/.$//' > total_stats.json
rm covid.html