Skip to content

Instantly share code, notes, and snippets.

@mpwoodward
mpwoodward / passenger_wsgi.py
Created Jun 17, 2016
Example passenger_wsgi.py file for running a Django application on Dreamhost with Passenger
View passenger_wsgi.py
import sys, os
cwd = os.getcwd()
sys.path.append(cwd)
sys.path.append(cwd + '/my_django_project')
INTERP = os.path.expanduser("~/.virtualenvs/my_django_project/bin/python3")
if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv)
@davidfowl
davidfowl / AUsage.cs
Last active Aug 15, 2022
Header propagation HttpClientFactory middleware
View AUsage.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddHttpClient("myclient");
// Global header propagation for any HttpClient that comes from HttpClientFactory
services.AddHeaderPropagation(options =>
{
options.HeaderNames.Add("Correlation-Id");
});
}
View aws-localstack-examples
############################################################################################################
################## #############################
################## #############################
This Gist collection contains all localstack related examples
################## #############################
################## #############################
############################################################################################################
@ryankurte
ryankurte / whatever.service
Created Jun 16, 2019
Minimal systemd unit
View whatever.service
# place in /etc/systemd/system/whatever.service and install with `systemd install whatever.service`
# note that if you change this file you will need to run `systemctl daemon-reload` to get systemd to notice
[Unit]
Description=A good service description
# After networking because we need that
After=network.target
[Service]
@wohlert
wohlert / Sinkhorn-solver.ipynb
Created Apr 3, 2019
Sinkhorn solver in PyTorch
View Sinkhorn-solver.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bcnzer
bcnzer / worker.js
Created Oct 15, 2018
Cloudflare Worker that uses Workers KV to get Authorization data. All authentication and authorization is done on the edge
View worker.js
addEventListener('fetch', event => {
event.respondWith(handleRequest(event))
})
/**
* Entry point of the worker
*/
async function handleRequest(event) {
try {
// Get the JWT
View terminal-cheat-sheet.txt
# Terminal Cheat Sheet
pwd # print working directory
ls # list files in directory
cd # change directory
~ # home directory
.. # up one directory
- # previous working directory
help # get help
-h # get help
@kvas7andy
kvas7andy / 1_MINOS_tutorial.md
Last active Aug 15, 2022
Brief explanation of MUNOS simulator usage
View 1_MINOS_tutorial.md
@adilanchian
adilanchian / WavePortal.sol
Last active Aug 15, 2022
Section 2: Write and deploy your WavePortal smart contract to a local Ethereum network
View WavePortal.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "hardhat/console.sol";
contract WavePortal {
uint256 totalWaves;
constructor() {
View mepr-account-nav-example.php
<?php
/*
Plugin Name: MemberPress Account Page Nav
Plugin URI: http://www.memberpress.com/
Description: Allows developers to add more nav menu links/pages to their members account page
Version: 1.0.0
Author: Caseproof, LLC
Author URI: http://caseproof.com/
Copyright: 2004-2013, Caseproof, LLC
*/