Skip to content

Instantly share code, notes, and snippets.

import {
CacheClient,
Configurations,
CredentialProvider,
ListCaches,
} from '@gomomento/sdk';
async function main() {
const momento = new CacheClient({
configuration: Configurations.Laptop.v1(),
@cprice404
cprice404 / CoroutineThingy.kt
Created August 18, 2021 13:01
Options for coroutines scopes in a library class
package momento.cacheadmin
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Deferred
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking
import java.io.Closeable
import java.util.concurrent.atomic.AtomicBoolean
def test_foo
now = Time.at(Time.now.to_i)
ca_exts = [
["basicConstraints","CA:TRUE",true],
["keyUsage","cRLSign,keyCertSign",true],
]
ee_exts = [
["keyUsage","keyEncipherment,digitalSignature",true],
]
ca1_cert = issue_cert(@ca1, @rsa2048, 1, now, now+3600, ca_exts,
@cprice404
cprice404 / foo.groovy
Created November 1, 2016 18:20
jobdsl configure called three times
def job = workflowJob(job_prefix) {
parameters {
...
}
definition {
cpsScm {
scm {
git {
remote {
url(git_repo)
@cprice404
cprice404 / lein-parent-notes.md
Last active October 13, 2016 16:36
lein-parent notes

lein-parent

Problem Statement

We've had an ongoing issue around the complexity of managing version numbers for Clojure libraries across all of our Clojure projects. We have well over 20 different Clojure repos now, and each of them can potentially specify its own version of every dependency that it consumes (including transitive dependencies). Lein's :pedantic? feature helps us ensure that we're using well-known, consistent versions of any given dependency within the context of an individual Clojure project, but it doesn't give us any guarantees of consistency across the projects, or in the final uberjar artifacts that we produce and package.

This is painful in terms of daily maintenance of the repos; any time you bump the version of one dependency for a project, there's a high likelihood that you'll end up needing to play the "lein whack-a-mole" game to resolve the versions of the other libraries that it brings in transitively. This led us to put together [this best practices document for mana

Hi everyone,
1.3.0 is out now. It’s the same as the previous RC build, for those of you on the EAP channel. For those of you on stable builds, here’s what’s new in 1.3.0.
The first is that it adds support for IntelliJ 2016.2, which is out today.
I’ve finally made the first steps towards better support for third party macros. What’s there now just allows you to configure custom forms to have the same symbol resolution as one of a handful of core macros, but hopefully support for def-style and let-style macros will cover a lot of the cases that are painful now. There’s documentation about this here. This is the first in a series of changes I’m planning to make macro support better across the board in Cursive.
There is now support for binding keys to send arbitrary commands to the REPL. This is something that will hopefully allow you to customise your workflows considerably, for example it should be a big help for those of you using the reloaded pattern. Documentation for this is here.
#!/usr/bin/env python2.7
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
what = ', "what?"' * 1024
whats_per_mb = (1024.0 * 1024.0) / len(what)
#cap = 2 * 1024 * 1024 * 1024
cap_mb = int(argv[2])
n = 0
!!!!!!!!!!!!!!!!!!!!!!!!OTHER.CLASS != SYMBOL: 'default' (Symbol), other: '-Infinity' (Float)
Puppet[:strict]: 'warning' (Symbol)
RAISING ERROR BECAUSE OF STRICT SYMBOL THING
!!!!!!!!!!!!!!!!!!!!!!!!OTHER.CLASS != SYMBOL: 'default' (Symbol), other: 'Infinity' (Float)
Puppet[:strict]: 'warning' (Symbol)
RAISING ERROR BECAUSE OF STRICT SYMBOL THING
!!!!!!!!!!!!!!!!!!!!!!!!OTHER.CLASS != SYMBOL: 'default' (Symbol), other: '-Infinity' (Float)
Puppet[:strict]: 'warning' (Symbol)
RAISING ERROR BECAUSE OF STRICT SYMBOL THING
!!!!!!!!!!!!!!!!!!!!!!!!OTHER.CLASS != SYMBOL: 'default' (Symbol), other: 'Infinity' (Float)
archive { 'git-client.hpi':
source => 'https://updates.jenkins-ci.org/download/plugins/git-client/1.19.6/git-client.hpi',
path => '/tmp/git-client.hpi',
checksum_verify => false,
checksum => undef,
checksum_type => 'sha1',
proxy_server => undef,
cleanup => false,
extract => false,
}
#!/usr/bin/env ruby
request_count = 0
catalog_request_count = 0
environment_cat_requests = {}
access_logs = Dir["*access*"]
access_logs.each do |f|
File.open(f).each do |line|
match = line.match(/^([^\s]+) - - - ([^\s])+ ([^s]+) ("[^\"]+") (\d+) (\d+) ([^\s]+) ([^\s]+) (\d+) (\d+)$/)