Skip to content

Instantly share code, notes, and snippets.

View AWattNY's full-sized avatar

Adam Watt AWattNY

View GitHub Profile
@AWattNY
AWattNY / introrx.md
Created April 2, 2017 23:55 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@AWattNY
AWattNY / introrx.md
Created April 2, 2017 23:55 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@AWattNY
AWattNY / circle.yml
Created April 27, 2017 17:48
circleci yml configuration file
dependencies:
override:
- sudo pip install awscli
deployment:
prod:
branch: master
commands:
- aws s3 sync /home/ubuntu/S3ContinuousDeploy s3://s3awscd --delete
@AWattNY
AWattNY / bucketPolicyExample.json
Created April 27, 2017 22:56
Read-Only Permission to an Anonymous User Bucket Policy
{
"Version":"2012-10-17",
"Statement":[
{
"Sid":"AddPerm",
"Effect":"Allow",
"Principal": "*",
"Action":["s3:GetObject"],
"Resource":["arn:aws:s3:::examplebucket/*"]
}
const isPalindrome = (string) => {
const reverse = string.split('').reverse().join('');
const isPalindrome = (string === reverse);
const result = isPalindrome ? `${string} is a Palindrome` : `${string} is not a Palindrome`;
return result;
};
exports.handler = (event, context, callback) => {
//some code here
callback(error, response);
};
var express = require('express');
var app = express();
app.get('/', function(req,res) {
res.send('hello world');
});
app.listen(3000);
//Test Case 1
//input >>>>>[1,4,2,4, [8, 10, 7], 3, [2, 12]]
// output >>>>> [1, 4, 2, 4, 8, 10, 7, 3, 2, 12]
//Test Case 2
// //input >>>>>[1, 4, 2, 4, [8, [10, 57, 61], 7], 3, [2, 12]]
// output >>>>> [ 1, 4, 2, 4, 8, 10, 57, 61, 7, 3, 2, 12 ]
//Test Case 3
// //input >>>>>[1, 4, 2, 4, [8, [10, [57, 108, 950], 61], 7], 3, [2, 12]]
@AWattNY
AWattNY / latency.txt
Created September 3, 2017 19:41 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD