Skip to content

Instantly share code, notes, and snippets.

View itinance's full-sized avatar

Hagen Hübel itinance

View GitHub Profile
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active June 20, 2024 14:04
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@davfre
davfre / git_cheat-sheet.md
Last active May 12, 2024 04:37
git commandline cheat-sheet
@jacksoncage
jacksoncage / HeartBleed-Debian-Wheezy-Update-OpenSSL-1.0.1e-2+deb7u4.sh
Last active September 2, 2015 20:31
HeartBleed-Debian-Wheezy-Update-OpenSSL-1.0.1e-2+deb7u4.sh
# Debian Wheezy - Fixing HeartBleed
# Installing 1.0.1e-2+deb7u4
# http://www.corsac.net/?rub=blog&post=1565
# https://security-tracker.debian.org/tracker/DSA-2896-1
#
# As pointed out, not the best secured way but fast. Please use 'apt-get && apt-get upgrade' for a more secure system.
MACHINE_TYPE=`uname -m`
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
wget http://security.debian.org/pool/updates/main/o/openssl/libssl1.0.0-dbg_1.0.1e-2+deb7u5_amd64.deb
@bcremer
bcremer / README.md
Last active May 23, 2016 10:43
Let's Encrypt and Nginx

Let's Encrypt

Using the Let's Encrypt (certbot)[https://certbot.eff.org/] with the webroot plugin in nginx.

Installation

Install certbot on a regular user-account:

wget https://dl.eff.org/certbot-auto
@beeman
beeman / remove-all-from-docker.sh
Created November 15, 2016 03:04
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@radiovisual
radiovisual / .eslintrc
Last active October 30, 2021 11:55
React Native AirBnB ESLint Config
{
"parser": "babel-eslint",
"plugins": [
"react",
"react-native"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"modules": true
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active June 19, 2024 00:49
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
...
handleGestureTerminationRequest = (e: GestureEvent, s: GestureState) =>
this.props.shouldRelease(s);
handleGestureCapture = (e: GestureEvent, s: GestureState) =>
this.props.shouldCapture(s);
handleGestureMove = (e: GestureEvent, { dx }: GestureState) => {
const currentOffset: number =
@theSage21
theSage21 / mailer.py
Last active January 15, 2024 03:08
Sending Files to My Kindle From Arxiv
# encoding: utf-8
# Install: pipenv install requests bs4 --python 3
# Usage: python mailer.py https://arxiv.org/abs/1805.12076
# Always supply an arxiv ABS page!!!
import sys
import os
import smtplib
import requests
@j05u3
j05u3 / lifecycle_aware_stream_builder.dart
Last active November 7, 2022 03:07
Lifecycle aware stream builder (flutter). Find more details on https://medium.com/p/a2ae7244af32
import 'dart:async';
import 'package:flutter/widgets.dart';
abstract class StreamBuilderBase<T, S> extends StatefulWidget {
/// Creates a [StreamBuilderBase] connected to the specified [stream].
const StreamBuilderBase({ Key key, this.stream }) : super(key: key);
/// The asynchronous computation to which this builder is currently connected,