Skip to content

Instantly share code, notes, and snippets.

View whalesalad's full-sized avatar
🐟
i've seen more spine in jellyfish

Michael Whalen whalesalad

🐟
i've seen more spine in jellyfish
View GitHub Profile
@whalesalad
whalesalad / ipmi_tool_fanspeed_r720.sh
Created June 11, 2020 18:23
ipmi_tool_fanspeed_r720.sh
brew install ipmitool
export IPMI_PASSWD="••••••••••••"
# List sensors
ipmitool \
-I lanplus \
-H thor-drac.ws.internal \
-U root \
-P $IPMI_PASSWD \
Bundler/OrderedGems:
Enabled: false
Bundler/SymbolArray:
Enabled: false
Layout/IndentationWidth:
Enabled: false
Layout/ElseAlignment:
defmodule Rabbit.Ublox do
alias __MODULE__
use Bitwise
defstruct msg_class: nil,
msg_id: nil,
payload: []
def list_to_binary(list) do
Enum.into(list, <<>>, fn byte -> <<byte::8>> end)
import io
import json
from service.memcached import client as memcached
from service.storage import utils
ONE_MEGABYTE = 1000 * 1000
@whalesalad
whalesalad / supycache_redis.py
Created April 8, 2019 02:22
work in progress!
import pickle
import supycache
from supycache.backends.base import BaseCache
from service.persistence import Redis
class SupyCacheRedisBackend(BaseCache):
def __init__(self, conn, prefix=None, config=None):
{
"assignments": {
"spl.user_overview.pilot": "control",
"IDPAXAccountRecoveryCopy": "two",
"DaxDwlTemplateDecisionIntegration": "treatment",
"dax_acq.dwl_email_first_reduced.DAXDwlEmailFirstReduced": "control",
"webclient.brochure_experiments.showRequestLyft": "treatment",
"webclient.welcome_redirect.FPRedirectDesktopWelcomeToRideLyft": "control",
"organic_growth.gift_card_footer.display_footer": "treatment",
"webclient.ride_request_flow.PGShowCreditCardModal": "treatment",
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import json
import copy
import itertools
base_policy = json.loads("""
{
{
"query": "<%= params[:query] %>",
"suggestions": [
<% size = @customers.size %>
<% @customers.each_with_index do |customer, i| %>
{
"value": "<%= customer.id %>",
"data": <%= raw customer._source.to_json %>
}<%= i + 1 == size ? "" : "," %>
<% end %>
require "json"
require "http/server"
server = HTTP::Server.new do |context|
environment = Hash.zip(ENV.keys, ENV.values)
context.response.content_type = "application/json"
context.response.print environment.to_json
end
@whalesalad
whalesalad / foo.py
Last active September 25, 2018 22:06
def handle_platypus(args):
pass
def handle_dog(args):
pass
def handle_cat(args):
pass
def fallback(args):