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
from typing import List | |
class RaceCar: | |
def __init__(self, car_number, driver_name): | |
self.car_number = car_number | |
self.driver_name = driver_name | |
class SessionResult: |
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
CREATE TABLE plant ( | |
PlantID INT PRIMARY KEY NOT NULL, | |
CommonName VARCHAR(128), | |
ScientificName VARCHAR(128), | |
PlantDescription VARCHAR(16384), | |
IsEdible TINYINT NOT NULL | |
); | |
CREATE TABLE attribute ( |
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
const express = require('express'); | |
const app = express(); | |
const bodyParser = require('body-parser'); | |
app.use(bodyParser.urlencoded()); | |
app.use(bodyParser.json()); | |
app.use(express.static(__dirname + '/public')); | |
app.post('/submit-customer', (req, res) => { |
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
<html> | |
<head> | |
<title>Rando Site</title> | |
</head> | |
<body> | |
<style> | |
a:hover { | |
background-color: #f00; | |
} |
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
let deduped = networks.reduce((previous, curr, idx, items) => { | |
let predicate = it => it.ssid === curr.ssid; | |
let existing = previous.find(predicate); | |
if (!existing) | |
previous.push(curr); | |
else | |
previous[previous.findIndex(predicate)] | |
.radio = items.map(it => | |
predicate(it) ? it.radio : null) |
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
import tweepy | |
import csv | |
def get_all_tweets(screen_name): | |
consumer_key = "" | |
consumer_secret = "" | |
access_key = "" | |
access_secret = "" |
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
import base64 | |
def read_image(filepath): | |
with open(filepath, "rb") as img_file: | |
encoded_str = base64.b64encode(img_file.read()) | |
return encoded_str | |
def write_decoded_image(output_path, encoded_str): | |
with open(output_path, "wb") as fh: | |
fh.write(base64.decodebytes(encoded_str)) |
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
import React from 'react'; | |
import {Item} from "./Item"; | |
export class Base extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
exampleValue: "Hello" |
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
[HttpPost("submit-comment")] | |
public async Task<ActionResult> SubmitComment([Required, FromBody] CommentSubmission submission) | |
{ | |
if (await Model.AddCommentSubmission(submission)) | |
return new OkResult(); | |
return new BadRequestResult(); | |
} | |
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
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<script> | |
var searchTerm = "word"; |
NewerOlder