Skip to content

Instantly share code, notes, and snippets.

@Firenza
Firenza / fiddler_with_python.md
Last active January 20, 2024 02:49
Get fiddler working with python requests module

Get fiddlers base64 encoded root certificate

  1. Install fiddler winget install -e --id Telerik.Fiddler
  2. Open fiddler and go to Tools -> Options -> HTTPS
  3. Enable Decrypt HTTPS traffic
  4. Click the Actions button and select Export root certificate to desktop
  5. Right click the FiddlerRoot.cer file on the desktop and click Open with -> Crypto Shell Extensions
  6. In the Certificate window that opens up go to Details -> Copy to File
  7. Click Next then select Base-64 encoded X.509 (.CER) then specify the file name (E.G. FiddlerRootBase64.cer)
  8. Click Next to create the new file
@pareekayush6
pareekayush6 / gist:b886b8f3596e7240186bb1aaad417a35
Last active September 20, 2023 22:06
S3keysensor example
from airflow.sensors.s3_key_sensor import S3KeySensor
from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow.utils.dates import days_ago
default_args = {
'owner': 'airflow',
'start_date': days_ago(1),
'email_on_failure': True,
@richlander
richlander / modernizing-csharp9.md
Last active April 26, 2024 17:14
Modernizing a codebase for C# 9

Modernizing a codebase for C# 9

There are lots of cases that you can improve. The examples use nullable reference types, but only the WhenNotNull example requires it.

Use the property pattern to replace IsNullorEmpty

Consider adopting the new property pattern, wherever you use IsNullOrEmpty.

string? hello = "hello world";
@JerryNixon
JerryNixon / XunitTestWithData.cs
Last active October 18, 2023 20:06
Using complex data types as InlineData for Xunit tests.
using System.Collections.Generic;
using System.Linq;
using Xunit;
namespace PlaygroundXunit
{
public class UnitTest1
{
[Theory]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
class KnapSack
{
// Returns the max value that can be put in a knapscak of capacity W
@RichardBronosky
RichardBronosky / pep8_cheatsheet.py
Created December 27, 2015 06:25
PEP-8 cheatsheet
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""This module's docstring summary line.
This is a multi-line docstring. Paragraphs are separated with blank lines.
Lines conform to 79-column limit.
Module and packages names should be short, lower_case_with_underscores.
Notice that this in not PEP8-cheatsheet.py
@NotFounds
NotFounds / Template.cs
Last active June 4, 2017 06:19
for Competition Programing in C# 6.0
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;
using static NotFounds.MyMath;
using static NotFounds.MyUtility;
namespace NotFounds
@sjednac
sjednac / UnboundedKnapsackDP.java
Last active June 4, 2017 06:01
Unbounded knapsack solver using dynamic programming approach.
import java.math.BigInteger;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
import java.util.function.BiFunction;
import java.util.stream.Collectors;
@frankmeola
frankmeola / XMLMinifier.cs
Last active August 24, 2022 10:11
A simple XML minifier in C#.
using System.IO;
using System.Text;
using System.Xml;
namespace XMLMinifier
{
/// <summary>
/// Config object for the XML minifier.
/// </summary>
public class XMLMinifierSettings
@automatonic
automatonic / MurMurHash3.cs
Created September 14, 2012 22:46
MurMurHash3 .Net (C#) implementation
/*
This code is public domain.
The MurmurHash3 algorithm was created by Austin Appleby and put into the public domain. See http://code.google.com/p/smhasher/
This C# variant was authored by
Elliott B. Edwards and was placed into the public domain as a gist
Status...Working on verification (Test Suite)
Set up to run as a LinqPad (linqpad.net) script (thus the ".Dump()" call)
*/