Skip to content

Instantly share code, notes, and snippets.

Avatar
👩‍💻
forever coding

Benjamin benjaminadk

👩‍💻
forever coding
View GitHub Profile
View fcc-pomodoro-clock-project.markdown

FCC Pomodoro Clock Project

Pomodoro Clock. Features an SVG I made. Its a clock that has three hands which spin at ten times minutes hours and seconds.

A Pen by Benjamin on CodePen.

License.

View fcc-wikipedia-viewer-project.markdown

FCC Wikipedia Viewer Project

Just type in search term and the app will pull up 5 Wikipedia entries on that term. It will include a brief description and a link to the actual Wikipedia page for that term. Clicking on the large Wikipedia icon will link to a random Wikipedia page. The Enter key also works to trigger your search.

A Pen by Benjamin on CodePen.

License.

View fcc-weather-app-project.markdown

FCC Weather App Project

Project uses api ip lookup and openweather api to get data on users location and local weather. App doesnt seem to work with https codepen so if there is a problem try switching to http.

A Pen by Benjamin on CodePen.

License.

@benjaminadk
benjaminadk / schema.js
Created Jul 31, 2017
my thoughts on schema
View schema.js
const userSchema = mongoose.Schema(
{
login: loginSchema
profile: profileSchema
skillTree: skillSchema
})
const loginSchema = mongoose.Schema(
{
username: {
@benjaminadk
benjaminadk / capture-snapshot.js
Created Oct 5, 2018
Takes a incoming stream and creates a snapshot image using canvas
View capture-snapshot.js
// Earlier in your code
var canvas = document.createElement('canvas')
var ctx = canvas.getContext('2d')
// Capture a stream and this function will create a snapshot
function captureSnapshot(stream) {
// Create a video element and style it so it is way off the screen
var video = document.createElement('video')
video.style.cssText = 'position: absolute; left: -10000px; top: -10000px;'
@benjaminadk
benjaminadk / build.js
Created Oct 6, 2018
A simple Electron build field configuration for Windows
View build.js
// build field from package.json
// productName - Output executable will be based on this, the official name of the app
// win - means we are targeting Windows
// icon - the icon for the executable file, taskbar, shortcuts, etc
// publish - automatically pushes the executable to a distribution platform
// provider - i am using github releases - people can go there and download my app
// owner - my github name
// target - type of build, there are more options for Windows - appx, squirrel as well as MacOS and Linux options
// directories - by default input dir is dist, here output is assigned to release - all built files will end up there
"build": {
@benjaminadk
benjaminadk / exam.js
Created Nov 5, 2018
Exam Simulator - JSON Format
View exam.js
// Exam Object
{
title: String, // Title of the exam - ex: "Network Administration"
code: String, // Optional 6 digit code - popular for technical certification exams - ex: "123-456"
pass: Number, // Passing score as a percentage - ex: 75
time: Number, // Time limit of exam in minutes - ex: 90
cover: [Node], // Array of Nodes - A way to visualize exam
test: [Questions] // Array of Questions - All questions that make up the exam
}
@benjaminadk
benjaminadk / question.js
Created Nov 5, 2018
Exam Simulator - Example Question
View question.js
{
variant: 1, // variant 1 for multiple-answer
question: [ // variant 1 for small text
{variant: 1, text: "Which two characters are convicted for the murder of Teresa Halbach?"}
],
choices: [ // sequential labels
{label: "A", text: "Earl Avery"},
{label: "B", text: "Chuck Avery"},
{label: "C", text: "Steve Avery"},
{label: "D", text: "Bobby Dassey"},
@benjaminadk
benjaminadk / download-json.js
Created Nov 6, 2018
Exam Simulator - Download JSON
View download-json.js
// Example State
this.state = {
name: "Johnny Smitherson",
age: "47",
employed: true
}
// Method to download as JSON file
downloadFile = () => {
const {name, age, employed} = this.state
View timer.js
class Component extends React.Component {
constructor(props) {
super(props)
this.state = {
time: null
}
}
componentDidMount() {