PEP - Python Enhancement Proposals - http://python.org/dev/peps
Docs - Language syntax and the Standard Library - http://docs.python.org/2/
PEP - Python Enhancement Proposals - http://python.org/dev/peps
Docs - Language syntax and the Standard Library - http://docs.python.org/2/
print('Tyler\'s python implementation of REPL.\n') | |
while True: | |
# Read - Get user input | |
read_value = raw_input('Ty\'s PyREPL >>> ') | |
# Eval - Run user input | |
try: | |
try: | |
out = eval(read_value) | |
except SyntaxError: |
I will be using this Gist throughout the presentation as a paste bin and to document some important notes.
After the presentation and throughout the workshop I will add additional content as questions are asked.
def import_class(import_string, *a, **k): | |
module, klass = import_string.rsplit('.', 1) | |
def combine_args_kwargs(args, kwargs): | |
new_args = a + args | |
new_kwargs = k.copy() | |
new_kwargs.update(kwargs) | |
return new_args, new_kwargs | |
def load_class(): |
from functools import wraps | |
def cache(func): | |
func.cache = None | |
@wraps(func) | |
def inner(*a, **k): | |
if func.cache is None: | |
func.cache = func(*a, **k) | |
return func.cache | |
return inner |
"use strict"; | |
angular.module('myModule', []). | |
factory('User', [function () { | |
function User (data) { | |
angular.extend(this, data); | |
} | |
User.prototype.getFullName = function () { |
package main | |
import ( | |
"context" | |
"net/http" | |
) | |
func main() { | |
helloHandler := AddMessageMiddleware("Hello!", http.HandlerFunc(RespondWithMessage)) | |
goodbyeHandler := AddMessageMiddleware("Goodbye!", http.HandlerFunc(RespondWithMessage)) |
package main | |
import ( | |
"net/http" | |
"fmt" | |
"errors" | |
"context" | |
) | |
// mock implementations |
func AddMessageMiddleware(message string, next http.Handler) http.Handler { | |
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |
oldCtx := nil // Get context from request | |
newCtx := oldCtx // modify context | |
next.ServeHTTP(w, r) // pass request to child handler | |
}) | |
} |
|- dist | |
| |- branch | |
| |- commit | |
| |- production | |
|- files |