Skip to content

Instantly share code, notes, and snippets.

// ************************************************
// Libraries
// ************************************************
#include <Arduino.h>
#include <Homie.h>
#include <DHT.h> //temperature, humidity sensor
// ************************************************
// Defines
// ************************************************
@prussiap
prussiap / Changes needed to get this up and running
Created April 28, 2014 13:28
SolarHub fixing after Merge
1. has_many contacts,
2.
3. Missing the accounts/subscription_processing
-- Had to add some development application constants
4. environments/development.rb
5. Had to add the chargify constants though I don't think tehse need to live in SH
6. Needed with_white_head template to layouts/
7. had to add layouts/solarnexus.html.haml
8 helper/ had to add solutions_helper.rb # probably doesn't need to be here
@prussiap
prussiap / Info
Last active August 29, 2015 14:00
Account Info
Total Accounts: 1119
Accounts with Private Accounts: 609
Of the accounts with owned products:
Total products Owned: 16362
Total Labor products owned: 9933
Total GeneralMaterial products owned : 5785
Owned_product_types: "Labor", "GeneralMaterial", "Kit", "MountingStructure", "DcOptimizer", "PvModule", "MeteringEquipment", "ElectricalEquipment", "Service", "InverterAccessory", "Tool"
Basic graphs and outlay of data can be found here: https://docs.google.com/spreadsheets/d/17h1NqNDSB_-A5kSPsJmDDJkF1mb2J69vZ7N0utvJlBU/edit?usp=sharing
@prussiap
prussiap / sim
Created April 20, 2014 23:29
Tau Simulation installation on OSX (Mavericks but should work on others)
I recently went through an instal of this great simulation software that works with Tau labs' version of GCS. This helps you fake telemetry and potentially fake flying with a UDP wrapper to GCS.
; First get yourself a copy of Tau labs source code
;: git clone git@github.com:TauLabs/TauLabs.git
; cd TauLabs
; Next is to install gcc48
;: First make sure you have xcode installed on your machine. This may take a while. You'll have to look for it in the appstore.
;: For gcc48 you need to have brew (many posts about installing brew)
;: type this in the cmd line: brew tap homebrew/versions
;: brew install gcc48
@prussiap
prussiap / make
Last active August 29, 2015 14:00
making simulation
make sim_osx_revolution_clean && make sim_osx_revolution && echo 'all good'
*NOTE* Sanitized disallowed variable 'TMPDIR' from environment
CLEAN sim_osx_revolution_clean
*NOTE* Sanitized disallowed variable 'TMPDIR' from environment
make[1]: Nothing to be done for `first'.
- Tau Labs UAVObject Generator -
Done: processed 107 XML files and generated 107 objects with no ID collisions. Total size of the data fields is 3484 bytes.
generating flight code
CC [sm|revo] flight/PiOS.osx/osx/Libraries/FreeRTOS/Source/list.c
CC [sm|revo] flight/PiOS.osx/osx/Libraries/FreeRTOS/Source/queue.c
@prussiap
prussiap / cinch
Last active August 29, 2015 14:00
require 'cinch'
bot = Cinch::Bot.new do
configure do |c|
c.nick = "hello_there"
c.server = "irc.freenode.org"
c.channels = ["#hacklab"]
end
------------ From Rake Task
namespace :app do
# Checks and ensures task is not run in production.
task :ensure_development_environment => :environment do
if Rails.env.production?
raise "\nI'm sorry, I can't do that.\n(You're asking me to drop your production database.)"
end
end
{-# LANGUAGE OverloadedStrings #-}
module FreightyCat where
import Control.Applicative
import Snap.Core
import Snap.Util.FileServe
import Snap.Http.Server
main :: IO ()
main = quickHttpServe site
import Network.HTTP.Conduit
import qualified Data.ByteString.Lazy as L
main :: IO ()
main = do
simpleHttp "http://www.digg.com" >>= L.writeFile "foo.txt"
@prussiap
prussiap / form
Last active January 3, 2016 22:19
full trace
= stylesheet_link_tag "gollum_editor/gollum"
= javascript_include_tag "gollum_editor/gollum"
= simple_form_for(@page, url: update_wiki_path, html: {method: "put"} ) do |f|
= f.input :name
= f.input :format,input_html: {value: "mediawiki"}
= f.gollum_editor :content
= f.fields_for :commit do |commit_fields|
= commit_fields.input :name, input_html: {value: "default name"}
= commit_fields.input :email, input_html: {value: "default@default.com"}
= commit_fields.input :message, input_html: {value: "Simple update"}