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
#!/usr/bin/env bash | |
########################################################################### | |
# # | |
# MINESTRAPS - A no-shit bootstrap script for Minecraft on Amazon Linux # | |
# Written By Joshua Saxby 2015 # | |
# # | |
########################################################################### | |
# Initialise config variables |
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
from operator import xor as _xor_ | |
def xor(a, b): | |
try: | |
if len(a) is not 1 and len(b) is not 1: | |
result = [] | |
for i in range(0,len(a)): | |
result.append(xor(a[i], b[i])) | |
return result | |
else: |
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
{ | |
"A": { | |
"B": ["A"] | |
}, | |
"B": { | |
"A": ["C", "AA"], | |
"C": ["A"], | |
"AA": ["A"] | |
}, | |
"C": { |
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
CREATE TABLE Orders( | |
Order_Number INT NOT NULL PRIMARY KEY AUTOINCREMENT, | |
Date_of_Order DATE, | |
Paid BOOLEAN DEFAULT false, | |
Delivery_ID INT, | |
Sandwich_Code INT, | |
Quantity INT DEFAULT 0, | |
Subtotal NUMERIC(5,2) | |
FOREIGN KEY(Delivery_ID) REFERENCES Deliveries(Delivery_ID), | |
FOREIGN KEY(Sandwich_Code) REFERENCES Sandwiches(Sandwich_Code) |
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
#!/usr/bin/python | |
from time import sleep | |
mass = 303209.382 # Kg of a tube train roughly | |
force = 0.0 # Newtons, initially set to 0 | |
accel = 0.0 # m/s^2, initially set to 0 | |
power = 0.0 # Newtons, force being applied | |
drag = 0.0 # Newtons, air resistance | |
roll = 0.0 # Netwons, rolling resistance | |
velocity = 0.0 # m/s, speed |
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 | |
#Make a new dir where you'll put the binary | |
sudo mkdir /opt/node | |
#Get it | |
wget http://nodejs.org/dist/v0.11.3/node-v0.11.3-linux-arm-pi.tar.gz | |
#unpack | |
tar xvzf node-v0.11.3-linux-arm-pi.tar.gz |
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 thresh(max=5000): | |
""" | |
Find the maximmum threshold of the paradoxical (i is 1000 = False) Phenomenon. | |
""" | |
p = 0 | |
n = 0 | |
n_break = False | |
p_break = False | |
for i in xrange(max): | |
if p is i: |
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
create table authors( | |
id integer primary key, | |
first_name varchar(127), | |
last_name varchar(127) | |
); | |
create table books( | |
id integer primary key, | |
title varchar(255), | |
author integer, |
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 flatten_list(l, ignore_iterables=True): | |
""" | |
Flatten out nested lists and return a non-nested list. | |
By default, ignores other iterables. | |
""" | |
if ignore_iterables: | |
arr = [] | |
if isinstance(l, list): | |
for item in l: | |
if isinstance(item, list): |
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 flatten_list(l, ignore_iterables=True): | |
""" | |
Flatten out nested lists and return a non-nested list. | |
By default, ignores other iterables. | |
""" | |
if ignore_iterables: | |
arr = [] | |
if isinstance(l, list): | |
for item in l: | |
if isinstance(item, list): |
OlderNewer