This file contains hidden or 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
| # solution to entry problem 1 | |
| def multiply(a, b): | |
| return a * b | |
| # solution to entry problem 2 | |
| class Person: | |
| def __init__(self, name): | |
| self.name = name | |
This file contains hidden or 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 | |
| # install linux headers | |
| wget https://raw.github.com/gkaindl/beaglebone-ubuntu-scripts/master/bb-get-rcn-kernel-source.sh | |
| chmod +x bb-get-rcn-kernel-source.sh | |
| sudo ./bb-get-rcn-kernel-source.sh | |
| # download backports drivers | |
| wget https://www.kernel.org/pub/linux/kernel/projects/backports/stable/v3.16/backports-3.16-1.tar.gz | |
| tar xvfz backports-3.16-1.tar.gz |
This file contains hidden or 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
| function control_zone() { | |
| this.var_a = 'a'; | |
| this.var_b = 'b'; | |
| this.var_c = 'c'; | |
| this.do_stuff = function() { | |
| // do stuff with variables | |
| console.log('var_a: '+this.var_a); | |
| console.log('var_b: '+this.var_b); | |
| console.log('var_c: '+this.var_c); |
This file contains hidden or 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 | |
| # Sass: http://sass-lang.com/ | |
| # Sass is a "smart" form of css, supporting nested targeting of html, variables and logic | |
| # scss is a variant of sass using a syntax much closer to css | |
| # Compass: http://compass-style.org/ | |
| # Compass is a sass framework containing a range of shortcuts for cross-browser css effects. | |
| # rounded corners, transparency... |
This file contains hidden or 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
| def Integer(obj): | |
| if obj["min"] < obj["value"] < obj["max"]: | |
| return True | |
| else: | |
| raise ValueError("value out of range") | |
| min_tile_size = {"type": Integer, | |
| "min": 10, | |
| "max": 20, | |
| "value": 15, |
This file contains hidden or 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
| ## Quick Bash ## | |
| function absolute_path { echo "$PWD/$1"; } | |
| alias ap="absolute_path" | |
| alias edbash='vim $HOME/.bash_aliases' | |
| alias upbash='source $HOME/.bashrc' | |
| ## apache ## | |
| alias apr='sudo apachectl graceful' | |
| alias apc='sudo apachectl' |
This file contains hidden or 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
| from livereload.task import Task | |
| def delay(): | |
| import time | |
| time.sleep(10) # 10s | |
| Task.add('*', delay) |
This file contains hidden or 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
| // Example testing sketch for various DHT humidity/temperature sensors | |
| // Written by ladyada, public domain | |
| #include "DHT.h" | |
| #define DHTPIN 2 // what pin we're connected to | |
| #define DHTPIN2 3 // what pin we're connected to | |
| // Uncomment whatever type you're using! | |
| #define DHTTYPE DHT11 // DHT 11 |
This file contains hidden or 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
| // Example testing sketch for various DHT humidity/temperature sensors | |
| // Written by ladyada, public domain | |
| #include "DHT.h" | |
| #define DHTPIN 2 // what pin we're connected to | |
| #define DHTPIN2 3 // what pin we're connected to | |
| // Uncomment whatever type you're using! | |
| #define DHTTYPE DHT11 // DHT 11 |
This file contains hidden or 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
| from math import cos, sin, atan2, sqrt | |
| def center_geolocation(geolocations): | |
| """ | |
| Provide a relatively accurate center lat, lon returned as a list pair, given | |
| a list of list pairs. | |
| ex: in: geolocations = ((lat1,lon1), (lat2,lon2),) | |
| out: (center_lat, center_lon) | |
| """ | |
| x = 0 |