This file contains hidden or 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
| print '=========== HEADS ============\n' | |
| with open('my-file.md', 'r') as file: | |
| lines = file.read().split('\n') | |
| heads = [] | |
| for i in lines: | |
| if '#' in i.split(' ')[0]: | |
| head = ' '.join(i.split(' ')[1:]) | |
| heads.append(head) |
This file contains hidden or 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
| import java.util.ArrayList; | |
| import java.util.List; | |
| /** | |
| * Times anything | |
| */ | |
| public class Timer { | |
| private double miliseconds; | |
| private Thread thread; | |
| private boolean timing; |
This file contains hidden or 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 a: String = "hello" // constant (value) | |
| var b: String = "goodbye" // variable | |
| fun main(args: Array<String>) { | |
| b = "oops" | |
| // kotlin handles null | |
| var myVar: String? = null // you can only asign null to optionals like this |
This file contains hidden or 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
| import numpy as np | |
| learn_rate = 0.01 | |
| # set inputs | |
| X = np.array([[1,1,1], | |
| [1,1,0], | |
| [1,0,1], | |
| [0,1,1], | |
| [0,1,0], |
This file contains hidden or 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
| ## 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 |
This file contains hidden or 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
| <!--<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> |
This file contains hidden or 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
| 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]; |
This file contains hidden or 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
| var COUNTER = 0; | |
| // first test case | |
| // should return 3 | |
| var nums = | |
| `~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| ~~~********~~~~~~~********~~~~ | |
| ~~~~****~~~~~~~~~~**~~*~**~~~~ | |
| ~~~~*~~~*~~~~~~~~~**~~~~**~~~~ | |
| ~~~~*~~~*~~~~~~~~~********~~~~ |
This file contains hidden or 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
| // 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" | |
| }); |
OlderNewer