Skip to content

Instantly share code, notes, and snippets.

View dannydenenberg's full-sized avatar
💃
Probably in a musical

Danny Denenberg dannydenenberg

💃
Probably in a musical
View GitHub Profile
import puppeteer from "puppeteer"; // import the npm package that we installed
(async () => {
// the rest of the code must be enclosed in an `async` function to be able to `await` for results
const browser = await puppeteer.launch(); // launches an "invisible" chromium browser
const page = await browser.newPage(); // takes the browser to a new tab (page)
await page.goto("https://example.com"); // takes the page to a specific url
// Get the "viewport" of the page,
// as reported by the page.
console.log("Twitter, here we come");
/* PrismJS 1.17.1
https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+c+bash+cpp+ruby+dart+markup-templating+docker+go+haskell+java+scala+php+markdown+json+jsonp+json5+latex+lisp+js-templates+typescript+scss+python+rust+sass+swift+yaml&plugins=line-numbers+normalize-whitespace */
/**
* prism.js Coy theme for JavaScript, CoffeeScript, CSS and HTML
* Based on https://github.com/tshedor/workshop-wp-theme (Example: http://workshop.kansan.com/category/sessions/basics or http://workshop.timshedor.com/category/sessions/basics);
* @author Tim Shedor
*/
code[class*="language-"],
pre[class*="language-"] {
/* PrismJS 1.17.1
https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+c+bash+cpp+ruby+dart+markup-templating+docker+go+haskell+java+scala+php+markdown+json+jsonp+json5+latex+lisp+js-templates+typescript+scss+python+rust+sass+swift+yaml&plugins=line-numbers+normalize-whitespace */
var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(g){var c=/\blang(?:uage)?-([\w-]+)\b/i,a=0,C={manual:g.Prism&&g.Prism.manual,disableWorkerMessageHandler:g.Prism&&g.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof M?new M(e.type,C.util.encode(e.content),e.alias):Array.isArray(e)?e.map(C.util.encode):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++a}),e.__id},clone:function n(e,t){var r,a,i=C.util.type(e);switch(t=t||
app.get("/:user", (req, res) => {
console.log(`[GET REQUEST TO /${user}] Sending back information about the user ${user}`);
}
// init project
const express = require('express'); // the library we will use to handle requests. import it here
const app = express(); // instantiate express
app.use(require("cors")()) // allow Cross-domain requests
app.use(require('body-parser').json()) // When someone sends something to the server, we can recieve it in JSON format
// base route. Responds to GET requests to the root route ('/')
app.get("/", (req, res) => {
res.send("Home sweet home 🏚") // always responds with the string "TODO"
});
@dannydenenberg
dannydenenberg / IslandsOnIslands.js
Created July 2, 2019 15:56
The Solution to the infamous `Islands on Islands` problem made by Mr. Thyden of Omaha Central High School
var COUNTER = 0;
// first test case
// should return 3
var nums =
`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~********~~~~~~~********~~~~
~~~~****~~~~~~~~~~**~~*~**~~~~
~~~~*~~~*~~~~~~~~~**~~~~**~~~~
~~~~*~~~*~~~~~~~~~********~~~~
import java.util.Scanner;
/**
* This class will contain an array of integer values and methods to update, search, sort and print the data.
*/
public class ArraySearchAndSort {
/**
* This array keeps track of all of the scores and can hold UP TO 100 elements
*/
static int[] scores = new int[100];
@dannydenenberg
dannydenenberg / gist-reveal.it-slides.html
Last active March 13, 2019 01:42 — forked from ryanj/gist-reveal.it-slides.html
Gist-powered Revealjs slideshow presentations http://gist-reveal.it
<!--<section data-background-transition='zoom' data-transition='concave' data-state='blackout'>-->
<section data-background-transition='zoom' data-state='blackout'>
<h2>My Gist! Cool. Daniel Denenberg</h2>
<h1>Made usingReveal.js</h1>
<h2>Slideshow Presentations</h2>
<br/>
<h1 class='fragment grow'><a style='color:deepskyblue;' href='http://gist-reveal.it'>gist-reveal.it</a></h1>
</section>
<section data-background-transition='zoom' data-transition='linear' id='try-it'>
<h2>Try it out!</h2>
## NOTE: When sending from gmail. The first time, it will tell you that there is suspicious acitivity going on. Just
# click on 'review activity' and say that it was you and then it will work.
# Python code to illustrate Sending mail from
# your Gmail account
import smtplib
def send_email(sender_email, sender_pass, recipient_email, subject, mes):
# creates SMTP session