Skip to content

Instantly share code, notes, and snippets.

[{"id":"38b3d402.ea080c","type":"tab","label":"Sun Rise/Set","disabled":false,"info":""},{"id":"a47bca9a.6702b8","type":"inject","z":"38b3d402.ea080c","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","x":490,"y":340,"wires":[["60b00846.bbb2a8"]]},{"id":"d8991dcf.b302a","type":"sun events","z":"38b3d402.ea080c","testmode":false,"verbose":true,"topic":"","name":"","x":970,"y":400,"wires":[["9f518344.f8e42","ef626aef.a4ab28"]]},{"id":"60b00846.bbb2a8","type":"change","z":"38b3d402.ea080c","name":"set GPS coords","rules":[{"t":"set","p":"payload.latitude","pt":"msg","to":"44.925370","tot":"num"},{"t":"set","p":"payload.longitude","pt":"msg","to":"-122.980020","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":400,"wires":[["d8991dcf.b302a"]]},{"id":"3e61578.9ad3ca8","type":"inject","z":"38b3d402.ea080c","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"120","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":490,"
[{"id":"38b3d402.ea080c","type":"tab","label":"Sun Rise/Set","disabled":false,"info":""},{"id":"a47bca9a.6702b8","type":"inject","z":"38b3d402.ea080c","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","x":490,"y":340,"wires":[["60b00846.bbb2a8"]]},{"id":"d8991dcf.b302a","type":"sun events","z":"38b3d402.ea080c","testmode":false,"verbose":true,"topic":"","name":"","x":970,"y":400,"wires":[["9f518344.f8e42","ef626aef.a4ab28"]]},{"id":"60b00846.bbb2a8","type":"change","z":"38b3d402.ea080c","name":"set GPS coords","rules":[{"t":"set","p":"payload.latitude","pt":"msg","to":"44.925370","tot":"num"},{"t":"set","p":"payload.longitude","pt":"msg","to":"-122.980020","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":400,"wires":[["d8991dcf.b302a"]]},{"id":"3e61578.9ad3ca8","type":"inject","z":"38b3d402.ea080c","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"120","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":490,"
@Shaolo
Shaolo / vls
Last active February 4, 2019 09:00
Quick command to give a nice vertical file listing with colors.
#!/usr/bin/env bash
ls -laG $1
@Shaolo
Shaolo / 0_reuse_code.js
Created August 8, 2017 21:29
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Shaolo
Shaolo / Relay Driver.asc
Last active September 25, 2017 07:03
Relay Driver V2
  • C:\development\mti-sellplug\Documents\Spice Sims\Relay driver 16A.asc V1 N001 0 5 V2 drv 0 3.3 Q1 vt N002 vb 0 2N3904 R2 vb 0 220 R3 N001 vt 63 R1 N002 drv 1.27k Q2 vt N003 vb2 0 2N3904 R4 vb2 0 3.3 R5 N003 drv 1.27k

### Keybase proof
I hereby claim:
* I am shaolo on github.
* I am shaolo (https://keybase.io/shaolo) on keybase.
* I have a public key ASD3Tv1FGOFc4w3412jvJvviA_DtMCdIDAbm3eP-Y41HEgo
To claim this, I am signing this object:
//: Playground - noun: a place where people can play
import UIKit
//import Foundation
var Vin:Double = 400
var r1:Double = 100
var r2:Double = 5
var Vout:Double = Vin * (r1 / (r1 + r2))
print(Vout)
Process: iTunes [86956]
Path: /Applications/iTunes.app/Contents/MacOS/iTunes
Identifier: com.apple.iTunes
Version: 11.0.3 (11.0.3)
Build Info: iTunes-1103042001000000~1
Code Type: X86-64 (Native)
Parent Process: launchd [190]
User ID: 502
Date/Time: 2013-05-22 07:39:17.530 -0700
@Shaolo
Shaolo / gist:5346352
Created April 9, 2013 14:54
Implementing finger drag for an iOS keyboard.
-(void)viewDidLoad{
[super viewDidLoad];
isButtonDown = NO;
youCounter = 0;
}
-(IBAction)downButtonDown:(id)sender{
isButtonDown = YES;
}
@Shaolo
Shaolo / gist:5346243
Created April 9, 2013 14:43
Updating scroll insets for a keyboard view
- (void) updateScrollInsets:(NSNotification *)notification {
//determine what portion of the view will be hidden by the keyboard
CGRect keyboardEndFrameInScreenCoordinates;
[[notification.userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] getValue:&keyboardEndFrameInScreenCoordinates];
CGRect keyboardEndFrameInWindowCoordinates = [self.view.window convertRect:keyboardEndFrameInScreenCoordinates fromWindow:nil];
CGRect keyboardEndFrameInViewCoordinates = [self.view convertRect:keyboardEndFrameInWindowCoordinates fromView:nil];
CGRect windowFrameInViewCoords = [self.view convertRect:self.view.window.frame fromView:nil];
CGFloat heightBelowViewInWindow = windowFrameInViewCoords.origin.y + windowFrameInViewCoords.size.height - (self.view.frame.origin.y + self.view.frame.size.height);
CGFloat heightCoveredByKeyboard = keyboardEndFrameInViewCoordinates.size.height - heightBelowViewInWindow;