Skip to content

Instantly share code, notes, and snippets.

View exp0nge's full-sized avatar
👨‍💻
selective compiling...

MD Islam exp0nge

👨‍💻
selective compiling...
View GitHub Profile
@exp0nge
exp0nge / step-2.js
Last active May 26, 2016 02:50
step-2
$(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
<span class='reset' style='visibility: hidden;'>
Filter: <span class='filter'></span>
</span>
<a class='reset' href="#" style='visibility: hidden;'>reset</a>
//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')))
@exp0nge
exp0nge / hcsr04_ultrasonic.py
Created February 19, 2017 03:05
hcsr04 with a fix for the stupid signal being frozen
# 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)
@exp0nge
exp0nge / python3_mraa_upm
Last active April 18, 2017 03:54 — forked from gaiar/python3_mraa_upm
How to install Python 3 with libmraa and upm
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
@exp0nge
exp0nge / nginx.conf
Created November 7, 2017 05:36 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
#!/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."
"""
Execute in Intel Edison
"""
import time
def does_module_exists(module_name):
try:
__import__(module_name)
except ImportError:
return False
#!/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!
apiVersion: v1
kind: Service
metadata:
name: markdownrender
labels:
app: markdownrender
spec:
type: NodePort
ports:
- port: 8080