Skip to content

Instantly share code, notes, and snippets.

View mackenziestarr's full-sized avatar
🌶️

Mackenzie Starr mackenziestarr

🌶️
View GitHub Profile
@mackenziestarr
mackenziestarr / sbt-build.diff
Created June 6, 2023 13:32
adds githubWorkflowBuildSbtStepPreamble, removes setting crossScalaVersions
diff --git a/build.sbt b/build.sbt
index ed64964..95294a6 100644
--- a/build.sbt
+++ b/build.sbt
@@ -16,8 +16,8 @@ def dev(ghUser: String, name: String, email: String): Developer =
inThisBuild(
List(
+ githubWorkflowBuildSbtStepPreamble := Seq(),
scalaVersion := Scala3,
@mackenziestarr
mackenziestarr / patch.diff
Created June 5, 2023 17:31
removing crossScalaVersions from project settings and project definitions, add missing compiler flags usually provided by sbt-typelevel during cross builds
diff --git a/build.sbt b/build.sbt
index ed64964..9ea86ef 100644
--- a/build.sbt
+++ b/build.sbt
@@ -17,7 +17,7 @@ def dev(ghUser: String, name: String, email: String): Developer =
inThisBuild(
List(
scalaVersion := Scala3,
- crossScalaVersions := List(Scala212, Scala213, Scala3),
+ crossScalaVersions := Nil,
@mackenziestarr
mackenziestarr / error.shell
Created September 29, 2022 20:25
Fs2CodeGeneratorSpec
sbt:e2e> project e2e
[info] set current project to e2e (in build file:/home/mstarr/development/fs2-grpc/)
sbt:e2e> +test
[info] Setting Scala version to 2.12.17 on 8 projects.
[info] Reapplying settings...
[info] set scmInfo to https://github.com/typelevel/fs2-grpc
[info] set current project to e2e (in build file:/home/mstarr/development/fs2-grpc/)
[info] Compiling 4 protobuf files to /home/mstarr/development/fs2-grpc/e2e/target/scala-2.12/src_managed/main/scalapb,/home/mstarr/development/fs2-grpc/e2e/target/scala-2.12/src_managed/main/fs2-grpc
fs2.grpc.e2e.Fs2CodeGeneratorSpec:
+ code generator outputs correct service file 0.005s
diff --git a/go/vt/vttablet/tabletserver/tabletenv/config.go b/go/vt/vttablet/tabletserver/tabletenv/config.go
index aa32f6880..6812e09f5 100644
--- a/go/vt/vttablet/tabletserver/tabletenv/config.go
+++ b/go/vt/vttablet/tabletserver/tabletenv/config.go
@@ -97,8 +97,8 @@ func init() {
flag.IntVar(&currentConfig.QueryCacheSize, "queryserver-config-query-cache-size", defaultConfig.QueryCacheSize, "query server query cache size, maximum number of queries to be cached. vttablet analyzes every incoming query and generate a query plan, these plans are being cached in a lru cache. This config controls the capacity of the lru cache.")
flag.IntVar(&currentConfig.SchemaReloadIntervalSeconds, "queryserver-config-schema-reload-time", defaultConfig.SchemaReloadIntervalSeconds, "query server schema reload time, how often vttablet reloads schemas from underlying MySQL instance in seconds. vttablet keeps table schemas in its own memory and periodically refreshes it from MySQL. This config controls the reload t
@mackenziestarr
mackenziestarr / cool-oneliners.sh
Created October 7, 2019 19:24
oneliners i like to use
# imagemagick make side-by-side image called z.png from x.png and y.png
# useful for sharing with people to visually compare things
convert +append x.png y.png z.png
(ns twelve-tone.core
(:use overtone.live))
;; reference: http://www.carolingianrealm.info/Music.php?MusicID=29
;; choose 12 notes
(def prime (shuffle (range 0 12)))
;; mathy function for generating the tone rows
(defn generate-tone-rows [prime]
(ns sha256-guess.core
(:import [java.security MessageDigest]
[javax.xml.bind DatatypeConverter]))
(defn- sha256-digest [bs]
(doto (MessageDigest/getInstance "SHA-256") (.update bs)))
(defn sha256 [msg]
(-> msg .getBytes sha256-digest .digest DatatypeConverter/printHexBinary))
@mackenziestarr
mackenziestarr / oauth2.md
Last active December 3, 2015 23:08
OAuth 2.0 Research

Oauth 2.0 Authorization Framework


###Difference between OpenID and OAuth

While OpenID is all about using a single identity to sign into many sites, OAuth is about giving access to your stuff without sharing >your identity at all (or its secret parts). [[1]][1]

The two can be used separately or together

  • OAuth negotiates getting users to grant access
// when updating the location path with search parameters
// add '?' to the path then serialize
Backbone.history.root = window.location.pathname + '?';
query = {"q":"Great Expectations"};
var url = $.param(query);
Backbone.history.navigate(url, {replace:true});
// localhost:8000/some/path?q=Great&20%Expectations
@mackenziestarr
mackenziestarr / run-ad-impressions.js
Created April 15, 2015 17:33
Try to run ad impressions in DFP with casperjs, doesn't work. Cool idea.
var casper = require('casper').create(), url, count;
var system = require('system');
if (! casper.cli.has(0)){
casper.echo('usage: run-ad-impressions.js <url> <number>');
}
url = casper.cli.get(0);
count = casper.cli.get(1);
casper.start(url);