Skip to content

Instantly share code, notes, and snippets.

@drewolbrich
drewolbrich / View+WindowGeometryPreferences.swift
Last active April 29, 2024 14:34
A visionOS SwiftUI view modifier that can be used to hide a window's resize handles or to constrain a window's aspect ratio
//
// View+WindowGeometryPreferences.swift
//
// Created by Drew Olbrich on 1/30/24.
// Copyright © 2024 Lunar Skydiving LLC. All rights reserved.
//
// MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@danieljimenez
danieljimenez / cloud-config
Last active February 7, 2017 01:16
TeamCity Agent Cloud Config
#cloud-config
# vim: syntax=yaml
# src: https://gist.github.com/danieljimenez/167d4e43fb41856c5671364d1e542d17
---
repo_update: true
repo_upgrade: all
manage_etc_hosts: true
output: { all : '| tee -a /var/log/cloud-init-output.log' }
final_message: "The system is finally up, after $UPTIME seconds"
@danieljimenez
danieljimenez / LambdaHandler.py
Last active March 30, 2018 16:48
Slack, Uber Eats
import logging
from urlparse import parse_qs
BODY_NAME = 'body-json'
class LambdaHandler:
def __init__(self, event, context, expected_tokens, method):
self.event = event
self.context = context
@shazow
shazow / learning-opengl.md
Last active August 14, 2018 18:36
Notes on learning OpenGL
@denji
denji / golang-tls.md
Last active April 29, 2024 03:39 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@SteelPangolin
SteelPangolin / EC2-Describe-IAM-policy.json
Created January 30, 2015 21:23
Get an Amazon Elastic Beanstalk environment's name from inside one of its instances
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"ec2:Describe*"
],
"Effect": "Allow",
"Resource": "*"
}
@philpennock
philpennock / nistbeaconcheck.go
Created January 1, 2015 07:27
Query the NIST randomness beacon, in Go
// Author: Phil Pennock
// Based on publicly available data, as described below, so the only creative
// input was the expression in Golang.
package main
/*
An overview is at <http://www.nist.gov/itl/csd/ct/nist_beacon.cfm> and while
the REST API is reliably available (in my experience) the content at
<https://beacon.nist.gov/home> is not, so I'll replicate the data here from
@kachayev
kachayev / concurrency-in-go.md
Last active March 11, 2024 11:27
Channels Are Not Enough or Why Pipelining Is Not That Easy

http://filippo.io/Heartbleed/ is a great service to the community.

I wouldn’t recommend testing hosts againt an online tool. All you do is create a log for a security savvy person with vulnerable hosts. While not quite the same, this is similar to uploading private keys or passwords to a service to check if they are secure.

Luckily it is easy to run the software locally, as the author was so kind to provide the source. I don’t read go very well, but a cursory glance suggests that the software does what it says on the tin, so we don’t worry about it phoning home.

This is the first time I’m building a go project, so I have to install go first. brew install go is easily done. You can get binary distributions for your OS from the go homepage: https://code.google.com/p/go/downloads/list

@fiorix
fiorix / gist:9664255
Created March 20, 2014 13:55
Go multicast example
package main
import (
"encoding/hex"
"log"
"net"
"time"
)
const (