Skip to content

Instantly share code, notes, and snippets.

View jaketclarke's full-sized avatar

Jake Clarke jaketclarke

View GitHub Profile
@kummerer94
kummerer94 / dash-example.py
Created April 6, 2023 09:21
This is an example for a Dash app that includes AAD auth.
import jwt
from dash import Dash, Input, Output, html
from flask import Flask, redirect, url_for
from flask_dance.contrib.azure import azure, make_azure_blueprint
from werkzeug.middleware.proxy_fix import ProxyFix
def login_required(func):
"""Require a login for the given view function."""
@gordthompson
gordthompson / postgresql_df_upsert.py
Last active August 21, 2024 17:07
Build a PostgreSQL INSERT … ON CONFLICT statement and upsert a DataFrame
# Copyright 2024 Gordon D. Thompson, gord@gordthompson.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@giohappy
giohappy / deploy-geoserver
Created June 21, 2021 20:05
Install GeoServer on cloud server with Ubuntu 20.04
# Install GeoServer on cloud server
________________
## 1. Install Java JDK
apt install openjdk-11-jdk
You can check the installation using `$ java -version`. Now you can see something like this:
openjdk version "11.0.7" 2020-04-14
@realmiketalbot
realmiketalbot / geoserver.conf
Created May 12, 2020 19:37
Configuration of geoserver.conf for https reverse proxy using nginx on Ubuntu 18.04
server {
listen 80;
listen [::]:80;
if ($scheme != "https"){
return 301 https://$host$request_uri;
}
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
@ajdruff
ajdruff / fix-git-line-endings
Last active August 16, 2024 20:55
Forces all line endings to LF in your git repo.
#####################
#
# Use this with or without the .gitattributes snippet with this Gist
# create a fixle.sh file, paste this in and run it.
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF)
# This Gist normalizes handling by forcing everything to use Unix style.
#####################
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bsweger
bsweger / useful_pandas_snippets.md
Last active April 19, 2024 18:04
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

@bkdinoop
bkdinoop / login-example
Last active May 21, 2024 06:25
Flask-Login : login.py created by https://github.com/maxcountryman : Matthew Frazier
# -*- coding: utf-8 -*-
"""
Flask-Login example
===================
This is a small application that provides a trivial demonstration of
Flask-Login, including remember me functionality.
:copyright: (C) 2011 by Matthew Frazier.
:license: MIT/X11, see LICENSE for more details.
"""