Skip to content

Instantly share code, notes, and snippets.

View mdewey's full-sized avatar
🐢
Being the sea turtle

Mark Dewey mdewey

🐢
Being the sea turtle
  • Office of CTO, VA, USDS
  • Pittsburg
  • 05:34 (UTC -04:00)
View GitHub Profile
function solution(input, markers) {
return input.split('\n').map((line) => {
let lineRv = "";
for(let i =0; i< line.length;i++){
if (markers.includes(line[i])){
i = line.length + 1;
} else {
lineRv += line[i]
}
}
CREATE TABLE books (
id SERIAL PRIMARY KEY,
title VARCHAR(100) NOT NULL,
primary_author VARCHAR(100) NULL
);
SELECT * FROM books WHERE title = 'goosebumps'
INSERT INTO books(title, author) VALUES
('goosebumps', 'R. L. Stine');
@mdewey
mdewey / JScript
Last active January 2, 2017 19:23
Marble controller
//GENERATES RANDOM HEX COLOR
function getRandomColor() {
var letters = '0123456789ABCDEF';
var color = '#';
for (var i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
$.ajax({
type: "POST",
url: url,
data: JSON.stringify(data),
contentType: 'application/json',
success: function (resp) {
console.log("success")
}
});