Skip to content

Instantly share code, notes, and snippets.

@jameskyle
jameskyle / s3client.scala
Last active June 8, 2023 22:48
Dynamic bucket lookup and cross region copy object support.
import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider
import software.amazon.awssdk.regions.Region
import software.amazon.awssdk.services.s3.S3Client
import software.amazon.awssdk.services.s3.model.{S3Exception,CopyObjectRequest,CopyObjectResponse,HeadBucketRequest}
import scala.util.{Try,Success,Failure}
/**
Cross region copy object example with region code discovery for a bucket.
**/
@jameskyle
jameskyle / gitconfig
Created March 10, 2022 21:51
Aliasess and short cuts for git.
[user]
name = <name>
email = <email>
username = <username>
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
@JsonIgnoreProperties(ignoreUnknown = true)
@Value
public class JsonExample {
@NonFinal
@JsonView(SerializedViews.Response.class)
boolean broken;
@NonFinal
@JsonView(SerializedViews.Response.class)
Boolean working;
#include <iostream>
using namespace std;
void overloaded(int a) {
cout << "This is an int: " << a << endl;
}
void overloaded(double a) {
cout << "This is a double: " << a << endl;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
file { '/etc/uber/redis_ports.d':
# see also celery_port_queues.d
ensure => 'directory',
owner => 'root',
group => 'root',
mode => '0444',
source => 'puppet:///modules/redis/empty/',
recurse => true,
ignore => '.empty',
purge => true,
from __future__ import division
import matplotlib
matplotlib.use('Agg')
import time
import sys
import math
import glob
import os
import cv2
from __future__ import print_function, division
import datetime as dt
import pandas as pd
import numpy as np
import scipy.optimize as sopt
def gradebook():
columns = ("Assignment", "Due", "Grade", "Weight")
import requests
import time
import gevent
from gevent.queue import JoinableQueue
class Consumer(object):
def __init__(self):
self.queue = JoinableQueue()
self.producers = [Producer(self.queue) for _ in range(10)]
import numpy as np
a = np.ones(shape=(1e9,), dtype=int)
print(a.shape)