I hereby claim:
- I am jmcclell on github.
- I am jmcclell (https://keybase.io/jmcclell) on keybase.
- I have a public key ASDUvWhJOeRBTzFftu-EnWeCdIxpWJ-oRHboumOxJciW1wo
To claim this, I am signing this object:
| {# | |
| This template snippet will take a page from a django Paginator and create a Twitter Bootstrap pagination HTML snippet. | |
| To use: | |
| {% include "path/to/django-paginator-bootstrap.html with page=contextVar only %} | |
| Optional variables: | |
| alignment - Accepts "centered" or "right". Other values have no affect. Default is left aligned. |
I hereby claim:
To claim this, I am signing this object:
| jason@mbp15r:~ > kops create cluster east.kube.REDACTED \ | |
| --node-count 3 \ | |
| --zones "us-east-1a,us-east-1b,us-east-1c" \ | |
| --master-zones "us-east-1a,us-east-1b,us-east-1c" \ | |
| --dns-zone kube.REDACTED \ | |
| --master-size m5.xlarge \ | |
| --node-size m5.xlarge \ | |
| --topology private \ | |
| --networking kube-router \ | |
| --ssh-public-key ~/.ssh/t.dsc.tv.pub \ |
Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * x| class Rational(initialNumer: Int = 1, initialDenom: Int = 1) { | |
| require(initialDenom != 0, "denominator must be nonzero") | |
| private val gcd = { | |
| def gcdRec(x: Int, y: Int): Int = { | |
| if(y == 0) x else gcdRec(y, x % y) | |
| } | |
| abs(gcdRec(initialNumer, initialDenom)) | |
| } | |
| # FOS Rest | |
| fos_rest: | |
| param_fetcher_listener: true | |
| body_listener: true | |
| format_listener: | |
| rules: | |
| path: ~ | |
| host: ~ | |
| priorities: | |
| name: [json, html] |
| ''' | |
| Template tag for returning Stackoverflow reputation | |
| Requires Py-StackExchange (https://github.com/lucjon/Py-StackExchange/) | |
| This isn't really meant to be consumed as-is for the following reasons: | |
| 1. Built in logic for caching isn't ideal for making this distributable | |
| 2. Having a template tag reach out to a 3rd party server could cause | |
| performance issues when rendering a template if the 3rd party server 404s |
| /** | |
| * @Route("/contact", name="_demo_contact") | |
| * @Template() | |
| */ | |
| public function contactAction(Request $request) | |
| { | |
| $contact = new Contact(); | |
| // Set a default for message inside the data object itself. | |
| // I expect that if message is missing in the request, this value will be used as the default | |
| $contact->setMessage("Default message from controller"); |
| {% for image in images %} | |
| {% image image.input | |
| filter='jpegoptim' output=image.output %} | |
| <img src="{{ asset_url }}" alt={{ image.alt }}"/> | |
| {% endimage %} | |
| // image.input ex: @AcmeFooBundle/Resources/public/images/example.jpg | |
| // iamge.output ex: /images/example.jpg |