Skip to content

Instantly share code, notes, and snippets.

View benjaminadk's full-sized avatar
👩‍💻
forever coding

Benjamin benjaminadk

👩‍💻
forever coding
View GitHub Profile
@benjaminadk
benjaminadk / fcc-pomodoro-clock-project.markdown
Last active May 21, 2017 16:27
FCC Pomodoro Clock Project

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.

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.

@benjaminadk
benjaminadk / fcc-weather-app-project.markdown
Last active May 21, 2017 17:48
FCC Weather App Project

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 July 31, 2017 01:56
my thoughts on schema
const userSchema = mongoose.Schema(
{
login: loginSchema
profile: profileSchema
skillTree: skillSchema
})
const loginSchema = mongoose.Schema(
{
username: {
@benjaminadk
benjaminadk / capture-snapshot.js
Created October 5, 2018 23:18
Takes a incoming stream and creates a snapshot image using canvas
// 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 October 6, 2018 02:35
A simple Electron build field configuration for Windows
// 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 November 5, 2018 22:17
Exam Simulator - JSON Format
// 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 November 5, 2018 23:24
Exam Simulator - Example Question
{
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 November 6, 2018 04:10
Exam Simulator - Download JSON
// Example State
this.state = {
name: "Johnny Smitherson",
age: "47",
employed: true
}
// Method to download as JSON file
downloadFile = () => {
const {name, age, employed} = this.state
@benjaminadk
benjaminadk / timer.js
Created November 12, 2018 01:12
Simple Timer
class Component extends React.Component {
constructor(props) {
super(props)
this.state = {
time: null
}
}
componentDidMount() {