Skip to content

Instantly share code, notes, and snippets.

@jglass
jglass / output.txt
Created January 20, 2022 21:52
Error output from beacon deploy
sh-5.1$ env DK_TAG=5 yarn deploy
yarn run v1.22.10
$ yarn build && yarn bundle && sam build --config-env ${DK_STAGE:-staging}-${DK_TAG:-1} && sam package --debug --config-env ${DK_STAGE:-staging}-${DK_TAG:-1}
$ spago build
Compiling DailyKos.Metrics.Beacon
Warning 1 of 2:
in module DailyKos.Metrics.Beacon
at src/DailyKos/Metrics/Beacon.purs:306:11 - 306:17 (line 306, column 11 - line 306, column 17)
<% if Rails.env.staging? %>
<% domain = "www.dailykosbeta.com" %>
<% else %>
<% domain = "www.dailykos.com" %>
<% end %>
<% if non_test_env? %>
... #javascript is the same except for line below
_sf_async_config.domain = "<%= domain %>"
@jglass
jglass / keybase.md
Last active July 25, 2019 18:26
Identity Verification

Keybase proof

I hereby claim:

  • I am jglass on github.
  • I am glassj67 (https://keybase.io/glassj67) on keybase.
  • I have a public key ASBU3ef0dKpwWNKnYh3p_7wVpmbn-U7PsYB6ns30mKJwnQo

To claim this, I am signing this object:

@jglass
jglass / index.js
Created March 24, 2017 18:00
Poker hand sorter w/ Lodash
const _ = require("lodash");
const suits = ["S", "H", "C", "D"];
const values = ["2", "3", "4", "5", "6", "7", "8", "9", "T", "J", "Q", "K", "A"];
createHand = (cards) => {
hand = [];
cards.forEach(function(card) {
hand.push(
{
suit: card[1],
<script type="text/javascript">
var _bftn_options = {
animation: 'banner',
position: 'bottomright',
theme: 'dark'
}
</script>
<script src="//fightforthefuture.github.io/battleforthenet-widget/widget.min.js"
async></script>
@jglass
jglass / Gemfile
Created May 27, 2011 21:27
My Solution to Gilded Rose Kata-- SPOILER ALERT
source 'http://rubygems.org'
gem 'rspec'
@jglass
jglass / Count vs. Length
Created March 23, 2011 16:54
Benchmark of count vs. length in Ruby
require 'rubygems'
require 'benchmark'
array = []
1.upto(1000000) { |i| array << i }
Benchmark.bm(7) do |r|
r.report("Count:") { array.count }
r.report("Length:") { array.length }
removeFst :: Int -> [Int] -> [Int]
removeFst m xs = mvOne m xs []
mvOne :: Int -> [Int] -> [Int] -> [Int]
mvOne m [] ys = mvAll [] ys
mvOne m (x:xs) ys | m /= x = mvOne m xs (x : ys)
| m == x = mvAll xs ys
mvAll :: [Int] ->[Int] -> [Int]
mvAll [] ys = reverse ys