By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents
import { Pipe } from 'angular2/core.js'; | |
/** | |
* Map to Iteratble Pipe | |
* | |
* It accepts Objects and [Maps](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) | |
* | |
* Example: | |
* | |
* <div *ngFor="#keyValuePair of someObject | mapToIterable"> |
import pytz | |
class MyView(MyModelView): | |
# Display the time in user's local timezone on the List View | |
column_formatters = | |
dict(scheduledtime=lambda v,c,m,p: m.scheduledtime.replace(tzinfo=pytz.utc).astimezone(tz=pytz.timezone(config.LOCAL_TIMEZONE))) | |
# Display the time in user's timezone on the Edit View | |
def edit_form(self, obj): | |
form = self._edit_form_class(get_form_data(), obj=obj) |
By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents
Proposed set of rules is an extension to baseUrl based mechanics used by RequireJS or SystemJS.
Core elements of the system are baseUrl and path mappings. Resolution process describes how they are used together.
All non-rooted paths are computed relative to baseUrl. Value of baseUrl is determined as either:
{ | |
"name": "webpack-ts-babel", | |
"version": "1.0.0", | |
"description": "", | |
"main": "webpack.config.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", |
from django.core.management.commands.shell import Command as ShellCommand | |
import os | |
class Command(ShellCommand): | |
shells = ShellCommand.shells.append('ptpython') | |
def ptpython(self): | |
try: | |
# old ptpython |
# -*- coding: utf-8 -*- | |
import wifi | |
def Search(): | |
wifilist = [] | |
cells = wifi.Cell.all('wlan0') |
// SocketIO cheat sheet | |
// SocketIO is a library that makes websockets communications easier. | |
// Page: http://socket.io/ | |
// ref: http://stackoverflow.com/a/10099325 | |
// send to current request socket client | |
socket.emit('message', "this is a test"); | |
// sending to all clients, include sender | |
io.sockets.emit('message', "this is a test"); |
# install dependencies | |
sudo apt-get update | |
sudo apt-get install -y build-essential | |
sudo apt-get install -y cmake | |
sudo apt-get install -y libgtk2.0-dev | |
sudo apt-get install -y pkg-config | |
sudo apt-get install -y python-numpy python-dev | |
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev | |
sudo apt-get install -y libjpeg-dev libpng-dev libtiff-dev libjasper-dev | |