This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function () { | |
d3.json('data.json', function (data) { | |
var ndx = crossfilter(data); // Tell Crossfilter what data we want to filter. | |
//defaultDim is for the total # of defaulters ticker. | |
var defaultDim = ndx.dimension(function (d) { | |
return d['default payment next month']; | |
}); | |
//genderDim filters based on gender. The function will iterate over the 30,000 records returning either Male, Female, or Unknown every time. | |
// We can then use dc.js to tally those up. | |
var genderDim = ndx.dimension(function (d) { //notice the parameter, since we told Crossfilter what our data is, we can just get it in our callbacks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span class='reset' style='visibility: hidden;'> | |
Filter: <span class='filter'></span> | |
</span> | |
<a class='reset' href="#" style='visibility: hidden;'>reset</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//again, get min/max for our x-axis | |
var limitBalMinMax = d3.extent(data, function (d) { | |
return d['LIMIT_BAL']; | |
}); | |
limitBalDefaultersChart | |
.width(900) | |
.height(250) | |
.dimension(limitDefaultersDim) | |
.group(limitDefaultersDim.group().reduceSum(dc.pluck('default payment next month'))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://stackoverflow.com/questions/32300000/galileo-and-ultrasonic-error-when-distance-less-than-4cm | |
import mraa | |
import time | |
trig = mraa.Gpio(3) | |
echo = mraa.Gpio(4) | |
trig.dir(mraa.DIR_OUT) | |
echo.dir(mraa.DIR_IN) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GETTING FROM REPO [Broken] | |
# Adding repositories and installing required software | |
echo "src/gz all http://repo.opkg.net/edison/repo/all" >> /etc/opkg/base-feeds.conf && echo "src/gz edison http://repo.opkg.net/edison/repo/edison" >> /etc/opkg/base-feeds.conf && echo "src/gz core2-32 http://repo.opkg.net/edison/repo/core2-32" >> /etc/opkg/base-feeds.conf && opkg update | |
# Updating mraa and upm | |
opkg upgrade libmraa0 && opkg upgrade upm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
( | |
dmesg -D | |
echo Scanning for wifi networks: | |
ifup wlan0 | |
wpa_cli scan | |
echo -e "\nStrongest networks found:" | |
wpa_cli scan_res | sort -grk 3 | head | awk -F '\t' '{print $NF}' | uniq | |
set -e | |
echo -e /"\nWARNING: this script will back up and remove all of your current wifi configs." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Execute in Intel Edison | |
""" | |
import time | |
def does_module_exists(module_name): | |
try: | |
__import__(module_name) | |
except ImportError: | |
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#----make sure this is run as root | |
user=`id -u` | |
if [ $user -ne 0 ]; then | |
echo "This script requires root permissions. Please run this script with sudo." | |
exit | |
fi | |
#----ascii art! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: markdownrender | |
labels: | |
app: markdownrender | |
spec: | |
type: NodePort | |
ports: | |
- port: 8080 |