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
functions: | |
create: | |
handler: todos/create.create | |
events: | |
- http: | |
path: todos | |
method: post | |
cors: true | |
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
# Update order file on s3 once order is fulfilled | |
def lambda_mark_order_fulfilled(event, context): | |
# Copy inputs into variables | |
bucket = event['Records'][0]['s3']['bucket']['name'] | |
key = event['Records'][0]['s3']['object']['key'] | |
order = key.split("/")[3] | |
s3 = boto3.client('s3') | |
# download file to /tmp | |
download_path = '/tmp/' + order; | |
s3.download_file(bucket, key, download_path) |
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 python | |
from airflow.models import DagBag | |
import sys,os | |
if len(sys.argv) == 1: | |
print "Dag folder needs to be provided as a parameter" | |
sys.exit(2) | |
print "==== Testing DAG loading ====" | |
db = DagBag(sys.argv[1]) | |
if len(db.import_errors) > 0: | |
print "There have been import errors, the following dag files are broken:" |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Hello Rust 👋</title> | |
<script src="hello.js"></script> | |
</head> | |
<body> | |
</body> | |
</html> |
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
fn main() { | |
let greetings = ["Hello", "Hola", "Bonjour", | |
"Ciao", "こんにちは", "안녕하세요", | |
"Cześć", "Olá", "Здравствуйте", | |
"Chào bạn", "您好", "Hallo", | |
"Hej", "Ahoj", "سلام","สวัสดี"]; | |
for (num, greeting) in greetings.iter().enumerate() { | |
print!("{} : ", greeting); | |
match num { | |
0 => println!("This code is editable and runnable!"), |
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
#[no_mangle] | |
pub extern "C" fn add_one(x: i32) -> i32 { | |
x + 1 | |
} |
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
(module | |
(type $t0 (func (param i32) (result i32))) | |
(func $add_one (export "add_one") (type $t0) (param $p0 i32) (result i32) | |
get_local $p0 | |
i32.const 1 | |
i32.add) | |
(table $T0 1 1 anyfunc) |
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
@Override | |
public void hear(final Event event) { | |
ExtensionErrorCallback<ExtensionError> errorCallback = new ExtensionErrorCallback<ExtensionError>() { | |
@Override | |
public void error(final ExtensionError extensionError) { | |
Log.e(AFEXTENSION, "error receiving sharedState event: "+ extensionError.getErrorName()); | |
} | |
}; | |
Map<String, Object> eventData = event.getEventData(); |
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
val unSaltedWindow = Window | |
.partitionBy($"client_id") // Note -- no salt | |
.orderBy($"install_count".desc) | |
val unSaltedResult = saltedResult | |
.withColumn("row_num", row_number().over(unSaltedWindow)) | |
.filter($"row_num" <= 1000) |
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
val saltedWindow = Window | |
.partitionBy($"client_id",$"salt") | |
.orderBy($"install_count".desc) | |
val saltedResult = dataWithSalt | |
.withColumn("row_num", row_number().over(saltedWindow)) | |
.filter($"row_num" <= 1000) |