Des-compressed from: http://www.writerscheatsheet.com/writing/
- Miraculous birth
- Hero's ordinary home-town (peaceful, waste-land, or suburbia)
- Dissatisfied ("I want")
- Call to adventure
- Refusal of call (or jumps)
# Taken from: http://stackoverflow.com/a/9728478/768671 | |
import os | |
def list_files(startpath): | |
for root, dirs, files in os.walk(startpath): | |
level = root.replace(startpath, '').count(os.sep) | |
indent = ' ' * 4 * (level) | |
print('{}{}/'.format(indent, os.path.basename(root))) | |
subindent = ' ' * 4 * (level + 1) |
import java.util.Collection; | |
import com.vaadin.data.Container; | |
import com.vaadin.data.util.BeanItemContainer; | |
import com.vaadin.ui.Component; | |
import com.vaadin.ui.DefaultFieldFactory; | |
import com.vaadin.ui.Field; | |
import com.vaadin.ui.Table; | |
@SuppressWarnings("serial") |
import java.util.Comparator; | |
import com.vaadin.data.Container.Sortable; | |
import com.vaadin.data.Item; | |
import com.vaadin.data.Property; | |
import com.vaadin.data.util.DefaultItemSorter; | |
/** | |
* The original need for this class is to provide a way of sorting by converted values instead of only the underlying | |
* property values. Sometimes a property is converted to be entirely different than the underlying property, and the |
#!/usr/bin/env python | |
''' | |
This script converts the output of Ansible's dynamic ec2.py to a flatly formmated static inventory file. | |
Before running this script run `python ./ec2.py --refresh-cache > ec2-dynamic.json` | |
See: http://docs.ansible.com/ansible/ec2_module.html | |
''' |
// My Reference Docs | |
// http://play.elevatorsaga.com/#challenge=5 | |
// http://play.elevatorsaga.com/documentation.html#docs | |
// https://www.codecademy.com/articles/glossary-javascript | |
// Passes through level 4 | |
// Sometimes passes 6 | |
// Also passes: 8, 9, 16 | |
{ |
{ | |
init: function(elevators, floors) { | |
log = function() { return console.log.apply(console, arguments); }; | |
for(i = 0; i < floors.length; i++) { | |
var floor = floors[i]; | |
log("Iterate Floor Num:" + floor.floorNum()) // I iterate as expected 1,2,3,4 | |
floor.on("up_button_pressed", function() { | |
log("floor[" + floor.floorNum() + "].up_button_pressed()") // I am always 4, what gives? | |
}); |
/* | |
Relevant dependencies: | |
<dependency> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-aspects</artifactId> | |
<version>4.2.7.RELEASE</version> | |
</dependency> | |
<dependency> | |
<groupId>org.mockito</groupId> | |
<artifactId>mockito-core</artifactId> |
package com.testing; | |
import com.testing.amqp.QpidRunner; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.testng.annotations.Test; | |
import javax.jms.*; | |
import javax.naming.Context; | |
import javax.naming.NamingException; |
import org.apache.http.conn.ConnectTimeoutException; | |
import org.apache.http.conn.HttpHostConnectException; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.retry.RetryCallback; | |
import org.springframework.retry.RetryContext; | |
import org.springframework.retry.RetryListener; | |
import org.springframework.retry.RetryPolicy; | |
import org.springframework.retry.backoff.ExponentialBackOffPolicy; |
Des-compressed from: http://www.writerscheatsheet.com/writing/