Skip to content

Instantly share code, notes, and snippets.

View Atlas7's full-sized avatar

Johnny Chan Atlas7

View GitHub Profile
@Atlas7
Atlas7 / Intel_Groove_LightSensorTriggerLEDs.md
Last active October 17, 2015 15:16
Hardware Project: Mouse Detector (with Light Sensor and LEDs)

How to find out when the mouse been eating my KitKat? A Mouse Detector built with Light Sensor and LEDs - just another fun project using Intel Edison Board, Arduino, Groove Light Sensor, Groove LEDs. See link below for NodeJS Script (to be run via Intel XDK IoT IDE).

I essentially started from the Groove LED script template and Groove Light Sensor script template, and combined the two ideas together. And we have a Light-sensor triggering LEDs mechanism! :)

See this YouTube demo.

/*jslint node:true, vars:true, bitwise:true, unparam:true */
/*jshint unused:true */
// Leave the above lines for propper jshinting
@Atlas7
Atlas7 / Intel_Edison_Grove_ButtonTriggeredLED.md
Last active October 17, 2015 15:14
Hardware Project: Simple Button-triggered LED

Like Master Wong says, "this move, basic and simple". (Simple Button-triggered LED device, made with: Intel Edison Board, Groove Button and LED, Intel XDK IoT Edition, NodeJS.).

See this YouTube Demo.

/*jslint node:true, vars:true, bitwise:true, unparam:true */
/*jshint unused:true */
// Leave the above lines for propper jshinting
//Type Node.js Here :)
@Atlas7
Atlas7 / SmartTouchAlertingSystem.md
Last active October 17, 2015 15:13
Hardware Project: Don't Tickle Me!

a Smart Alerting System leveraging Touch Sensor and LED. (Intel Edison Board, Arduino, Grove Touch Sensor and LED, Intel XDK IoT Edition IDE, NodeJS).

See this YouTube demo.

/*jslint node:true, vars:true, bitwise:true, unparam:true */
/*jshint unused:true */
// Leave the above lines for propper jshinting
//Type Node.js Here :)
@Atlas7
Atlas7 / js_func_test.md
Created October 26, 2015 10:47
JavaScript - Parsing function as an argument

Quick JavaScript demo:

  • parsing function as an argument
  • assigning a function as a variable (essentially making a copy of the function under a different name)
function sumIt (a, b) {
	console.log("sumIt...")
	return a + b;
};
@Atlas7
Atlas7 / javascript_function_syntax.md
Created October 30, 2015 13:49
JavaScript - Function Syntax

Learnt a new type of syntax around function today, so thought I would make a quick note here!

The following two examples are equivalent:

Example 1

var i = 1;
console.log( function (j) {return j+100} (i) ) ;
// return 101
@Atlas7
Atlas7 / Udacity-Web-Development-Install-Google-App-Engine.md
Last active March 18, 2017 00:41
Udacity - Web Development - Install Google App Engine

Follow this Udacity Instruction to put create a simple web app via Google App Engine.

Youtube Link here.

Install the Python App Engine SDK (for Mac, in my case).

After installation some new symbolic links are created under /usr/local/bin - taken a snapshot for future refernce (just in case!)

google_app_engine_mac_symlink.png

@Atlas7
Atlas7 / blog.md
Created January 5, 2016 20:16
Inline commenting within a Jinja2 HTML template

Learnt something new today. If we are to perform an inline commenting within a Jinja2 HTMl template...

The following will be rendered as a comment - via the {# and #} tags.

{# {{ Hello World }} #}

The following however may cause problem - because Jinja2 will try to parse the Python variable Hello and World, which may not exist.

@Atlas7
Atlas7 / demo.md
Last active October 16, 2018 17:29
Udacity - Web Development - Hashing with iPython - Demo
@Atlas7
Atlas7 / mac_shortcuts.md
Created January 12, 2016 10:13
Some very handy Mac shortcuts

Dan Rodney has some great Mac shortcuts at his blog here. Below are some of my favorites.

shortcut description
cmd + tab switch apps
cmd + alt + left/right arrow switch tab within an app
cmd + ` (backtick) switch windows within the same app
@Atlas7
Atlas7 / blogpost.md
Last active January 12, 2016 15:47
Udacity - Web Development - Python urllib2

Some simple iPython scripts to illustrate the use of Python urllib2 library. e.g. to interact with the web.

Unknown:apps johnny$ ipython
Python 2.7.10 |Anaconda 2.4.0 (x86_64)| (default, Oct 19 2015, 18:31:17) 
Type "copyright", "credits" or "license" for more information.

IPython 4.0.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.