Skip to content

Instantly share code, notes, and snippets.

View maciejmajewski's full-sized avatar

Maciej Majewski maciejmajewski

  • Szczecin, Poland
View GitHub Profile
@maciejmajewski
maciejmajewski / newrelic_grape.rb
Last active January 11, 2016 15:15
Grape instrumentation with NewRelic RPM 3.9.x & Rails
if defined?(NewRelic)
module NewRelic
module Agent
module Instrumentation
class Grape < ::Grape::Middleware::Base
def before
begin
NewRelic::Agent.set_transaction_name(transaction_name,
category: :rack)
rescue => e
gem "minitest", "~> 5.11"
gem "mongoid", "~> 7.0"
@maciejmajewski
maciejmajewski / cloudformation.yml
Created February 4, 2019 14:05
AWS API Gateway HTTP proxy CloudFormation template
AWSTemplateFormatVersion: 2010-09-09
Parameters:
HostName:
Type: String
Description: Name of the instance, in host-friendly name - underscored. Will be concatenated into .on-pulse.com domain
ProxyHost:
Type: String
Description: Host that should be proxied
HostedZoneName:
Type: String

Keybase proof

I hereby claim:

  • I am maciejmajewski on github.
  • I am mmaj (https://keybase.io/mmaj) on keybase.
  • I have a public key ASAbUc2tK4SE1DCjsf2it0cHhDlINBBkUMfNTABNovmB5wo

To claim this, I am signing this object:

exchange-rates() {
DATE="${1:-}"
FILTER=".[] | {"
FILTER+="table: .table,"
FILTER+="no: .no,"
FILTER+="date: .effectiveDate,"
FILTER+='"EUR": .rates[] | select(.code == "EUR").mid,'
FILTER+='"USD": .rates[] | select(.code == "USD").mid'
FILTER+="}"
@maciejmajewski
maciejmajewski / prusa_mini.gcode
Created December 9, 2021 09:42
Prusa MINI Start G-Code "Pretty"
G90 ; use absolute coordinates
M83 ; extruder relative mode
M140 S[first_layer_bed_temperature] ; set bed temp
M104 S160 ; set extruder temp for bed leveling
M190 S[first_layer_bed_temperature] ; wait for bed temp
G28 ; home all without mesh bed level
G29 ; mesh bed leveling
M104 S[first_layer_temperature] ; set extruder temp
G92 E0.0
G1 Y-2.0 X179 F2400
@maciejmajewski
maciejmajewski / ha-automation-shelly.yaml
Created April 6, 2022 10:53
Shelly Button Automations
alias: Living Room F1 F2 F*
description: ''
trigger:
- platform: device
domain: mqtt
device_id: 967c22b13ac4d96b7033ac98a3cdaa98
type: button_short_press
subtype: button_3
discovery_id: shellypro4pm-083af27beeec-input-2 single_push
id: f1