Skip to content

Instantly share code, notes, and snippets.

View MikeTrizna's full-sized avatar

Mike Trizna MikeTrizna

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@frankie567
frankie567 / interactive_google_oauth2.py
Last active July 29, 2023 22:07
Interactive Google OAuth2 flow with Streamlit
import asyncio
import streamlit as st
from httpx_oauth.clients.google import GoogleOAuth2
st.title("Google OAuth2 flow")
"## Configuration"
client_id = st.text_input("Client ID")
@lexnederbragt
lexnederbragt / to_jupyter.md
Last active October 29, 2022 20:22
Tools to generate Jupyter Notebooks from plain (markup) text files

Tools to generate Jupyter Notebooks from plain (markup) text files:

(Originally posted on twitter, here incorporating responses)

pandoc

As of version 2.6, there is provisional support for using pandoc using jupyter notebookss (.ipynb files) as input and output format.

Notedown

Markdown to Jupyter Notebook, and back https://github.com/aaren/notedown

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@DragonBe
DragonBe / php_apache_homebrew.md
Last active July 4, 2024 17:15
Installation of Apache 2.4 and PHP 7.1 with Homebrew

I posted several talks about compiling PHP from source, but everyone was trying to convince me that a package manager like Homebrew was a more convenient way to install.

The purpose of Homebrew is simple: a package manager for macOS that will allow you to set up and install common packages easily and allows you to update frequently using simple commands.

I used a clean installation of macOS Sierra to ensure all steps could be recorded and tested. In most cases you already have done work on your Mac, so chances are you can skip a few steps in this tutorial.

Apache and PHP with homebrew

I’ve made this according to the installation instructions given on GetGrav.

@stefansundin
stefansundin / requests_api.py
Last active July 17, 2024 23:43
Reusable class for Python requests library.
# http://docs.python-requests.org/en/master/api/
import requests
class RequestsApi:
def __init__(self, base_url, **kwargs):
self.base_url = base_url
self.session = requests.Session()
for arg in kwargs:
if isinstance(kwargs[arg], dict):
kwargs[arg] = self.__deep_merge(getattr(self.session, arg), kwargs[arg])
@smeschke
smeschke / geoplotting
Last active August 17, 2016 20:57
Plotting the Proliferation of Mormon Temples with Basemap
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import csv
#get list of temple name, location, dedication data, lat, and lon
path = '/home/sm/Desktop/temple_data.csv'
temples = [] #create a list to store the temple data from the spread sheet
with open(path, 'rb') as csvfile: #open the csv file
temple_data = csv.reader(csvfile, delimiter=',', quotechar='"') #load temple data
for temple in temple_data: #iterate through data to change year to int
@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active July 22, 2024 13:58
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@chrismdp
chrismdp / s3.sh
Last active March 5, 2024 12:57
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@keithshep
keithshep / csv_to_hdf5.py
Created November 5, 2014 17:33
convert CSV file to HDF5 using h5py
#!/usr/bin/env python -O
import argparse
import sys
import numpy
import h5py
import csv
class ColType:
UNKNOWN = 1