Skip to content

Instantly share code, notes, and snippets.

@akashpalrecha
akashpalrecha / an-inquiry-into-matplotlib-figures.ipynb
Last active January 13, 2023 16:32
An Inquiry into Matplotlib's Figures, Axes, subplots and the very amazing GridSpec!
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# This template is a Cloud Formation template, that has AWS Sam seamlessly mixed in
# It is extremely powerful as you will see!
# This is a template of Lambda & RDS, publically available (so no private VPC)
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31 # This is to tell cloudformation we need to transform this template, as it has SAM!
Description: Severless set up with an RDS
######## ### ######## ### ## ##
## ## ## ## ## ## ## ## ### ###
@zznate
zznate / MyClusterManager.java
Created October 14, 2015 23:01
Example of a "Component" or "Resource" controlling Cassandra access
public class MyClusterManager {
private Session session;
private Cluster cluster;
@javax.annotation.PostConstruct
public void init() throws IOException
{
cluster = createCluster(); // private method that builds a cluster
session = createSession(); // private method that builds a session
@devsprint
devsprint / gist:5363023
Last active November 3, 2020 02:51
Write a blob content to Cassandra using datastax\java-driver
private static String WRITE_STATEMENT = "INSERT INTO avatars (id, image_type, avatar) VALUES (?,?,?);";
private final BoundStatement writeStatement=writeStatement = session.prepare(WRITE_STATEMENT)
.setConsistencyLevel(ConsistencyLevel.LOCAL_QUORUM).bind();
try {
BoundStatement stmt = driver.getWriteStatement();
stmt.enableTracing();
stmt.setLong("id", accountId);
stmt.setString("image_type", image.getType());
stmt.setBytes("avatar", ByteBuffer.wrap(image.getBytes()));