Skip to content

Instantly share code, notes, and snippets.

View fridgebuzz's full-sized avatar

Vanessa Williams fridgebuzz

View GitHub Profile
@JeffreyPalmer
JeffreyPalmer / savePreviousFxhashesInLocalStorage.html
Last active November 29, 2022 18:51
Code to save fxhash hashes in local browser storage
<!DOCTYPE html>
<html lang="en">
<head>
<script>
// Put the following code into your index.html
// Store previous hashes
const storedKeys = JSON.parse(localStorage.getItem('fxhashes')) || [];
if (!storedKeys.includes(fxhash)) {
storedKeys.length >= 10 && storedKeys.shift();
@mattdesl
mattdesl / palette-btoa.js
Last active December 14, 2023 21:49
palette compression
// Polyfill so we can run this in Node.js as well
if (typeof atob !== 'function') {
var atob = a => Buffer.from(a, 'base64').toString('binary')
var btoa = b => Buffer.from(b).toString('base64');
}
// 511 bytes after minify
var a=[
["#1b6f3f", "#10c5b4", "#ade4cd", "#29ec19"],
["#96bde8", "#246a85", "#3483e4", "#b168f6"],
@brendandawes
brendandawes / tools.md
Last active April 25, 2024 14:44
[Work in Progress] Tools — a constantly expanding list of some of the tools and services I use to make things, both hardware and software. Things can only appear on this list if it's something I've personally used to make things.
@fridgebuzz
fridgebuzz / RiakKVClient.java
Created February 23, 2016 17:17
Simple Key-Value Java Client for Riak
public class RiakKVClient
{
/**
* Constructor. Use RiakProvider.getStoreClient(name) instead.
* @param name bucket name
* @param client low-level Riak Java client instance
*/
protected RiakKVClient(final String name, final com.basho.riak.client.api.RiakClient client)
{
@agoston
agoston / TransactionTemplate.java
Last active July 27, 2023 18:18
JdbcTemplate manual transaction example, using TransactionTemplate
//[... initialize ...]
final SimpleDataSourceFactory simpleDataSourceFactory = new SimpleDataSourceFactory("com.mysql.jdbc.Driver");
final DataSource dataSource = simpleDataSourceFactory.createDataSource(jdbcUrl, user, pass);
jdbcTemplate = new JdbcTemplate(dataSource);
final DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(dataSource);
transactionTemplate = new TransactionTemplate(transactionManager);
transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
@garyrussell
garyrussell / ContainerRetryTests-context.xml
Last active December 13, 2022 19:03
Spring AMQP Container Retry Example - uses the default retry template (3 attempts and no recovery - the failed message is just logged at WARN level). Inject a `RetryTemplate` into the factory bean for more options.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:rabbit="http://www.springframework.org/schema/rabbit"
xsi:schemaLocation="http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit-1.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<rabbit:connection-factory id="connectionFactory" />
<rabbit:template id="amqpTemplate" connection-factory="connectionFactory"
@SzymonPobiega
SzymonPobiega / gist:5220595
Last active April 25, 2024 17:19
DDD/CQRS/ES/Architecture videos

If you have two days to learn the very basics of modelling, Domain-Driven Design, CQRS and Event Sourcing, here's what you should do:

In the evenings read the [Domain-Driven Design Quickly Minibook]{http://www.infoq.com/minibooks/domain-driven-design-quickly}. During the day watch following great videos (in this order):

  1. Eric Evans' [What I've learned about DDD since the book]{http://www.infoq.com/presentations/ddd-eric-evans}
  2. Eric Evans' [Strategic Design - Responsibility Traps]{http://www.infoq.com/presentations/design-strategic-eric-evans}
  3. Udi Dahan's [Avoid a Failed SOA: Business & Autonomous Components to the Rescue]{http://www.infoq.com/presentations/SOA-Business-Autonomous-Components}
  4. Udi Dahan's [Command-Query Responsibility Segregation]{http://www.infoq.com/presentations/Command-Query-Responsibility-Segregation}
  5. Greg Young's [Unshackle Your Domain]{http://www.infoq.com/presentations/greg-young-unshackle-qcon08}
  6. Eric Evans' [Acknowledging CAP at the Root -- in the Domain Model]{ht