- I did this as root:
$ sudo su
, although it may not be necessary. - Download AWS command line tools:
$ curl https://raw.github.com/timkay/aws/master/aws -o aws
- Install:
- Automatically:
$ perl --install aws
- Manually:
$ mv aws /usr/local/bin/ && chmod +x /usr/local/bin/aws
- Automatically:
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 | |
# Authorize TCP, SSH & ICMP for default Security Group | |
#ec2-authorize default -P icmp -t -1:-1 -s 0.0.0.0/0 | |
#ec2-authorize default -P tcp -p 22 -s 0.0.0.0/0 | |
# The Static IP Address for this instance: | |
IP_ADDRESS=$(cat ~/.ec2/ip_address) | |
# Create new t1.micro instance using ami-cef405a7 (64 bit Ubuntu Server 10.10 Maverick Meerkat) |
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
using Microsoft.Phone.Controls; | |
using System; | |
using System.Windows.Controls.Primitives; | |
/// <summary> | |
/// This class detects the pull gesture on a LongListSelector. How does it work? | |
/// | |
/// This class listens to the change of manipulation state of the LLS, to the MouseMove event | |
/// (in WP, this event is triggered when the user moves the finger through the screen) | |
/// and to the ItemRealized/Unrealized events. |
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 cycle_key(self): | |
#TODO: Errors here will tank the system, probably need some better handling... | |
old_session_key = self.session_key | |
old_session = Session.objects.get(session_key=old_session_key) | |
try: | |
cart = Cart.objects.get(session=old_session) | |
super(SessionStore, self).cycle_key() | |
new_session_key = self.session_key | |
new_session = Session.objects.get(session_key=new_session_key) | |
cart.session = new_session |
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
import unittest | |
class FizzBuzzException(Exception): | |
pass | |
def fizz_buzz(param): | |
result = "" | |
try: | |
variable = int(param) | |
except ValueError: |
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
import csv | |
def get_input(passed): | |
"""This function converts a string to an integer | |
and returns None when the string isn't an integer""" | |
try: | |
number_of_courses = int(passed) | |
except ValueError: | |
number_of_courses = None | |
return number_of_courses |
$ npm install -g create-react-app
$ create-react-app frontend
$ cd frontend
$ yarn add react-router-dom styled-components react-loadable react-app-rewired
$ touch config-overrides.js
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
{ | |
"name": "frontend", | |
"version": "0.1.0", | |
"private": true, | |
"dependencies": { | |
"react": "^16.2.0", | |
"react-dom": "^16.2.0", | |
"react-loadable": "^5.3.1", | |
"react-router-dom": "^4.2.2", | |
"react-scripts": "1.0.17", |
$ yarn add --dev dynamic-cdn-webpack-plugin # load react from a cdn when built in production mode
$ yarn add --dev module-to-cdn # required by dynamic-cdn-webpack-plugin
$ yarn add --dev react-app-rewire-preact # install preact-compat
$ yarn add --dev react-app-rewire-styled-components # ability to use babel plugin of styled-components
$ yarn add --dev preload-webpack-plugin # ability to prefetch all code splitted routes/components.
OlderNewer