This gist provides the learning-python3.ipynb notebook file, which can be viewed and edited in a Jupyter Notebook server to learn Python 3.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
def curry_function(fun, execute_time): | |
fun.call(self, execute_time) | |
end | |
def tick(self): | |
execute_time = time.now | |
[function1, function2].each do |fun| | |
new_function = curry_function(fun, execute_time) | |
Thread.new | |
publisher.pub(new_func.call(self)) |
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
defmodule MyList do | |
def sum([], total), do: total | |
def sum([ head | tail], total), do: sum(tail, head+total) | |
end |
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 | |
# Create and configure a AWS IOT | |
# | |
set -e | |
echo -e "What is the device name? \c" | |
read NAME | |
# Create the IOT device | |
aws iot create-thing --thing-name $NAME |
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
dict = { | |
"sensor_unit" => { | |
"current_location" => { | |
"lat" => 39.508577, | |
"long" => -115.9377, | |
"time" => 1461608442 | |
}, | |
"rad_sensor_attributes" => [ | |
{ | |
"sensor_id" => "sensor_12", |
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
```ruby | |
[1] pry(#<Warden::Proxy>)> env | |
=> {"GATEWAY_INTERFACE"=>"CGI/1.1", | |
"PATH_INFO"=>"/admin/news/new", | |
"QUERY_STRING"=>"", | |
"REMOTE_ADDR"=>"127.0.0.1", | |
"REMOTE_HOST"=>"localhost", | |
"REQUEST_METHOD"=>"GET", | |
"REQUEST_URI"=>"http://127.0.0.1:60474/admin/news/new", | |
"SCRIPT_NAME"=>"", |
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
jQuery(function($) { | |
var nl_map = function(existing) { | |
var zoom, default_zoom; | |
var is_select = false; | |
var field_prefix = NLGEO.field_prefix; | |
if (NLGEO.zoom_field != 0) |
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
//current workflow | |
//Inside of callback function on file upload completion | |
var $container = $(".advertising_entities"); | |
$container.find(".has_many_add").trigger("click"); | |
//better workflow | |
var $container = $(".advertising_entities"); | |
var $has_many_element = $container.find(".has_many_add"); | |
activeAdmin.api.form.add_has_many($has_many_element); |
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
info: Retrieving plugin | |
info: Loading facts in /var/lib/puppet/lib/facter/mysql.rb | |
info: Loading facts in /var/lib/puppet/lib/facter/augeasversion.rb | |
info: Caching catalog for dbdev.envelo.cc | |
info: Applying configuration version '1348777448' | |
notice: /Stage[main]/App/Spree::App[spree]/File[/data/spree/shared/config/database.yml]/content: | |
--- /data/spree/shared/config/database.yml 2012-10-30 20:05:57.000000000 +0000 | |
+++ /tmp/puppet-file20121030-16069-126gln7-0 2012-10-30 20:06:40.000000000 +0000 | |
@@ -2,5 +2,5 @@ | |
adapter: mysql2 |