Skip to content

Instantly share code, notes, and snippets.

@superroma
superroma / 1view-model-resolver.js
Last active August 14, 2020 09:35
View model resolvers
const ticketQueryResolver = (queryParams, viewModel, {jwt, resolve, decode}) => {
const ticketId = queryParams
const ticketEvents = viewModel.getAllEvents().filter(event => event.type != TICKET_ESCALATED)
if (!jwt) throw new AccessDeniedException()
const ticket = resolve.buildViewModel(viewModel.name, ticketId)
const product = resolve.buildViewModel("product", ticket.productId)
return {
data: {
@superroma
superroma / control.py
Created October 14, 2018 14:34
Temperature and power monitor
# -*- coding: utf-8 -*-
from time import sleep
import sys
import random
import cloud4rpi
import ds18b20
import rpi
import RPi.GPIO as GPIO # pylint: disable=F0401
from os import uname
from socket import gethostname
import sys
import time
import cloud4rpi
import rpi
import tilt
# Put your device token here. To get the token,
# sign up at https://cloud4rpi.io and create a device.
# Put variable declarations here
variables = {
'CPU Temp': {
'type': 'numeric',
'bind': rpi.cpu_temp
}
}
import time
import tilt
while True:
res = tilt.getFirstTilt()
print res
time.sleep(2)

The schema defines the following types:

FermentableBase

FermentableBase provides unique properties to identify individual records of fermentable ingredients

FermentableBase type: object

Properties

#!/bin/sh
#
IPSEC_PSK=<some key>
VPN_USER=root
VPN_PASSWORD=<vpn pass>
PUBLIC_IP=<your server ip>
apt-get update
@superroma
superroma / cs1.callstack
Last active March 9, 2016 16:11
Call stack
> WindowsFormsApplication66.exe!ConsoleApplication1.Program.test() Line 28 C#
WindowsFormsApplication66.exe!ConsoleApplication1.Program.Main(string[] args) Line 30 C#
[Native to Managed Transition]
[Managed to Native Transition]
mscorlib.dll!System.AppDomain.ExecuteAssembly(string assemblyFile, System.Security.Policy.Evidence assemblySecurity, string[] args) Unknown
Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() Unknown
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.Con