This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import yaml | |
def load_and_assert_uniqueness(x): | |
# We'd like to detect duplicates. Since PyYAML both loads things depth-first | |
# *and* doesn't give us the parent when processing a child node, we'll index | |
# of all of the object IDs as we're constructing them, and then see which | |
# are disappeared from the final hierarchy. Since all we can do is pass a | |
# class, we need to inline the class in order to load into an index within | |
# our scope. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# MIT LICENSE | |
# | |
# Copyright 2023 Dustin Oprea | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the “Software”), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
import requests | |
_PUBLIC_SECRET = os.environ['KLAVIYO_PUBLIC_SECRET'] | |
_API_ROOT = 'https://a.klaviyo.com/api' | |
_VALID_EXTRA_ATTRIBUTES = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string | |
import yaml | |
def load_yaml(f, context=None): | |
if context is None: | |
context = {} | |
def string_constructor(loader, node): | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//============================================================================ | |
// Name : SSLClient.cpp | |
// Compiling : g++ -c -o SSLClient.o SSLClient.cpp | |
// g++ -o SSLClient SSLClient.o -lssl -lcrypto | |
//============================================================================ | |
#include <stdio.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <openssl/ssl.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This file had now been added to the git repo | |
https://github.com/darrenjs/openssl_examples | |
... which also includes a non blocking client example. | |
------------------------------------------------------------------------------- | |
ssl_server_nonblock.c -- Copyright 2017 Darren Smith -- MIT license |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import ldap | |
import collections | |
# Install: | |
# | |
# apt: libsasl2-dev | |
# pip: python-ldap | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import os | |
import argparse | |
import shutil | |
_DESCRIPTION = "Strip extended characters from all non-hidden files in a path." | |
def _get_args(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
HEAD_COMMIT_MESSAGE=$(git log --format=%B -1 HEAD) | |
# For safety. Our use-case is usually to always just squash into a commit | |
# that's associated with an active change. We really don't want lose our head | |
# and accidentally squash something that wasn't intended to be squashed. | |
if [[ "${HEAD_COMMIT_MESSAGE}" != SQUASH* ]]; then | |
echo "SQUASH: Commit to be squashed should have 'SQUASH' as its commit-message." | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3.5 | |
""" | |
A simple module to resolve a Go import path to the actual URL that hosts that | |
package. Sometimes these are not equal and you mustload one URL (and zero or | |
more redirects) until we encounter a meta tag that specifies the true import | |
URL. | |
Requirements: | |
- requests | |
- beautifulsoup4 |
NewerOlder