Skip to content

Instantly share code, notes, and snippets.

View frootloops's full-sized avatar

Arsen Gasparyan frootloops

  • Revolut
  • Russia, Moscow
View GitHub Profile
#
# This file configures the New Relic Agent. New Relic monitors
# Ruby, Java, .NET, PHP, and Python applications with deep visibility and low overhead.
# For more information, visit www.newrelic.com.
#
# Generated March 25, 2014
#
# This configuration file is custom generated for Wannafun
[
{ "id": 1, "title": "title #1", "text": "text #1" },
{ "id": 1, "title": "title #2", "text": "text #2" },
{ "id": 1, "title": "title #3", "text": "text #3" },
{ "id": 1, "title": "title #4", "text": "text #4" },
{ "id": 1, "title": "title #5", "text": "text #5" }
]
@frootloops
frootloops / r1
Created September 13, 2015 11:05
{}
class BinHeap:
def __init__(self):
self.heapList = [0]
self.currentSize = 0
self.swaps = []
def percUp(self,i):
while i // 2 > 0:
if self.heapList[i] < self.heapList[i // 2]:
tmp = self.heapList[i // 2]
{
{ "name": "name #1" }
}
func doit() {
let arsen = User(id: "1", name: "Arsen", age: 26)
TrackingProvider().track(event: UserEvents.created(user: arsen))
}
protocol TrackingEventType {
var identifier: String { get }
var properties: [String: Any] { get }
}
enum UserEvents {
case created(user: User)
case openApp
case bought(product: Product)
case sentMessage
}
extension UserEvents: TrackingEventType {
var identifier: String {
switch self {
case .created:
return "user.created"
case .openApp:
return "user.open-app"
case .bought:
return "user.bought"
case .sentMessage:
protocol TrackingProviderType {
func track(event: TrackingEventType)
func associate(with user: User)
func disassociateUser()
func setup()
}