Skip to content

Instantly share code, notes, and snippets.

View cmchap's full-sized avatar

Cory Chainsman cmchap

View GitHub Profile
@cmchap
cmchap / Raspberry_Pi_Water_Sensor
Last active May 28, 2024 12:55
Raspberry Pi Water Sensor - Incredibly vague schematic here: http://fritzing.org/projects/raspberry-pi-water-sensor/
#!/usr/bin/python
#########
# About #
#########
# This script uses a Raspberry Pi to sense for the presense or absense of water.
# If there is water, an email is sent and a buzzer goes off.
# When it's dry again, another email is sent, and the buzzer turns off.
@cmchap
cmchap / index.html
Last active August 29, 2015 13:56 — forked from GerHobbelt/.gitignore
D3.js streamgraph
<!DOCTYPE html>
<html>
<head>
<title>Streamgraph</title>
<link href='http://fonts.googleapis.com/css?family=PT+Sans+Narrow:700,400|Rock+Salt' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="http://d3js.org/d3.v2.js"></script>
<script type="text/javascript" src="stream_layers.js"></script>
<style>
#chart {
font: 12px/18px 'Rock Salt',sans-serif;
@cmchap
cmchap / copyrightNotice.js
Last active August 29, 2015 14:01
CopyrightNotice: a jQuery plugin to create an always-up-to-date copyright notice
/*
* Javascript CopyrightNotice
*
* Copyright (c) 2014 Cory Chapman
* Licensed under the MIT license
*
* For more info on copyright see: http://www.bitlaw.com/copyright/formalities.html
*
* Example usage:
* $('.copyright').copyrightNotice({ byLine: 'Cory Chapman', published: false });

Keybase proof

I hereby claim:

  • I am cmchap on github.
  • I am cmchap (https://keybase.io/cmchap) on keybase.
  • I have a public key whose fingerprint is 8D18 1B18 AABF A4CD 361F 3CAF 3D52 511F 09D5 2FEB

To claim this, I am signing this object:

import sys
def calc_weight(c, m):
return sum(
[c_i * (m_i + 100) for m_i, c_i in zip(m, c)])
def main():
if len(sys.argv) < 1: