This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\timing | |
\set PROMPT1 '%[%033[33;1m%]%x%[%033[0m%]%[%033[1m%]%/%[%033[0m%] %m %R%# ' | |
\pset null 'NULL' | |
\pset border 2 | |
\x auto | |
\set HISTCONTROL ignoredups | |
\set COMP_KEYWORD_CASE upper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install ipmitool | |
export IPMI_PASSWD="••••••••••••" | |
# List sensors | |
ipmitool \ | |
-I lanplus \ | |
-H thor-drac.ws.internal \ | |
-U root \ | |
-P $IPMI_PASSWD \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bundler/OrderedGems: | |
Enabled: false | |
Bundler/SymbolArray: | |
Enabled: false | |
Layout/IndentationWidth: | |
Enabled: false | |
Layout/ElseAlignment: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io | |
import json | |
from service.memcached import client as memcached | |
from service.storage import utils | |
ONE_MEGABYTE = 1000 * 1000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import redis | |
from django.conf import settings | |
from django.http import StreamingHttpResponse as HttpResponse | |
def new_connection(): | |
""" | |
At some point this will evolve into using a connection pool, | |
but for now it opens a new connection for each user. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import json | |
import copy | |
import itertools | |
base_policy = json.loads(""" | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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 %> |
NewerOlder