Skip to content

Instantly share code, notes, and snippets.

Lyle Mantooth IslandUsurper

Block or report user

Report or block IslandUsurper

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@IslandUsurper
IslandUsurper / pe_18.rs
Created Oct 8, 2014
What can I do to prevent borrowing errors?
View pe_18.rs
use std::io::{BufferedReader, File};
use std::num::FromStrRadix;
#[deriving(Show)]
struct TreeNode<'a> {
value: uint,
left: Option<&'a TreeNode<'a>>,
right: Option<&'a TreeNode<'a>>,
}
@IslandUsurper
IslandUsurper / gist:12723643dddc9315ff71
Created Mar 10, 2015
Behat Step to select an autocomplete suggestion
View gist:12723643dddc9315ff71
<?php
use Behat\Mink\Extension\ElementNotFoundException;
use Drupal\DrupalExtension\Context\DrupalContext;
class FeatureContext extends DrupalContext {
/**
* @When I select the first autocomplete option for :prefix on the :field field
*/
@IslandUsurper
IslandUsurper / aws.yml
Last active Jun 15, 2016
Setting up VPC subnets
View aws.yml
- name: Create VPC
ec2_vpc_net:
cidr_block: 10.0.0.0/16
name: {{ Environment }}
state: present
tenancy: default
register: vpc
- name: Create Internet gateway
ec2_vpc_igw: vpc_id={{ vpc.vpc.id }} state=present
@IslandUsurper
IslandUsurper / flatten.py
Created Sep 19, 2016
Flatten an arbitrarily nested array
View flatten.py
def flatten(items):
"""
Flatten a nested list of integers.
Passing a non-list instead returns a list containing the argument.
"""
if not isinstance(items, list):
return [items]
result = []
@IslandUsurper
IslandUsurper / example.xml
Created Dec 22, 2017
Rust and XML schema
View example.xml
<ErrorRecovery>
<ListID>1235623425</ListID>
<EditSequence>whatever</EditSequence>
</ErrorRecovery>
<ErrorRecovery>
<OwnerID>FOO</OwnerID>
</ErrorRecovery>
<ErrorRecovery>
<TxnID>18302-1488303-random-numbers</TxnId>
<TxnNumber>9492023</TxnNumber>
View keybase.md

Keybase proof

I hereby claim:

  • I am islandusurper on github.
  • I am islandusurper (https://keybase.io/islandusurper) on keybase.
  • I have a public key ASAG0Zto9GNYzTvF6tgz6hLRhzKr8qU7nHTGvh8Ad5rU7wo

To claim this, I am signing this object:

You can’t perform that action at this time.