Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View noahlz's full-sized avatar
🕵️‍♂️
Secret Stuff for SEI Novus. I might take 1 - 3 days to respond.

Noah Zucker noahlz

🕵️‍♂️
Secret Stuff for SEI Novus. I might take 1 - 3 days to respond.
View GitHub Profile
/**
* non-performant solution to https://twitter.com/Al_Grigor/status/1357028887209902088
* scala> partitionCount("aaaabbbcca")
* res0: List[(Char, Int)] = List((a,4), (b,3), (c,2), (a,1))
* PS see "stringly" for a better solution in clojure.
* Is there a scala equivalent to this? Feel free to comment.
* (->> (partition-by identity s) (map frequencies) seq))
*/
def partitionCount(s: String): List[(Char, Int)] = {
s.toList.foldLeft(List.empty[(Char, Int)]) { (agg, c) =>
@noahlz
noahlz / ubuntu-1204-lts-tls-1.2.md
Last active January 11, 2022 00:03
HOWTO Upgrade to TLS 1.2 on Ubuntu 12.04 LTS

Hacker News actually made my life better:

https://news.ycombinator.com/item?id=13539034

Test procedure that doesn't require 3rd-party libs:

  • For Python 2:
$ python -c "import json, urllib2; print json.load(urllib2.urlopen('https://www.howsmyssl.com/a/check'))['tls_version']"
@noahlz
noahlz / salat-release.text
Created August 12, 2017 13:10
Salat release command line history (from sbt)
clean
++ 2.11.8 publishSigned
++ 2.11.8 sonatypeRelease
++ 2.10.6 publishSigned
++ 2.10.6 sonatypeRelease
++ 2.12.2 publishSigned
++ 2.12.2 sonatypeRelease

Keybase proof

I hereby claim:

  • I am noahlz on github.
  • I am noahlz (https://keybase.io/noahlz) on keybase.
  • I have a public key ASBYapMXW39QysqyLFXcYNWfTOzLutqRlw06F9KM2tKBDwo

To claim this, I am signing this object:

@noahlz
noahlz / dell-xps-13-ubuntu-15.04-upgrade.md
Last active January 20, 2016 01:41
Upgrading to Ubuntu 15.04 on an Dell XPS 13 Laptop

I figured out why you might be having issues upgraded the operating system. I spoke to our engineers, and unfortunately, with our Dell image there are proprietary drivers and repositories. This will cause an issue and prevent you from upgrading to 15.04/15.10.

If you want to see how the system will operate in 15.10 without installing it first, you can run the ‘live cd’ on the system and see how it works with the touch pad. That way you can decide whether or not you would like to upgrade.

Here is the link for the download: http://www.ubuntu.com/download/desktop

In order to use this, you will need to boot from a flash drive.

  1. Power on the system and press F12
@noahlz
noahlz / slack.sh
Last active June 29, 2020 15:22
Post Bamboo Builds to Slack via curl
#!/bin/bash
WEBHOOK_URL=$1
# https://confluence.atlassian.com/display/BAMBOO050/Bamboo+variables#Bamboovariables-Build-specificvariables
PLAN="${bamboo.buildPlanName}"
RESULTS="${bamboo.buildResultsUrl}"
KEY="${bamboo.buildResultKey}"
BRANCH="${bamboo.repository.branch.name}"
## Simple extension of the Chef tutorial for appending line(s) to the end of a cookbook
## Alternative to copying an entire cookbook just to add one line to a config file.
## (Apparently, partials are an alternative in Chef 11?
## http://stackoverflow.com/a/19167106/7507
file 'motd' do
content "hello chef\n"
end
ruby_block "ensure sig to end of file" do
scala> val x = 1 :: 2 :: 3 :: Nil
x: List[Int] = List(1, 2, 3)
scala> val y = 1 :: 2 :: 4 :: Nil
y: List[Int] = List(1, 2, 4)
scala> x union y
res1: List[Int] = List(1, 2, 3, 1, 2, 4)
scala> res1.distinct
@noahlz
noahlz / SalatSandbox.scala
Last active August 29, 2015 14:07
Salat Sandbox
package noahlz
import com.novus.salat._
import com.novus.salat.global._
import com.novus.salat.grater
import scala.util.control.NonFatal
case class Data(name: String, datums: Vector[Double])
case class MaybeData(name: String, datums: Vector[Option[Double]])
case class Datum(d: Option[Double])