Skip to content

Instantly share code, notes, and snippets.

View beaucarnes's full-sized avatar
💭
Follow me on Twitter: @beaucarnes

Beau Carnes beaucarnes

💭
Follow me on Twitter: @beaucarnes
View GitHub Profile
@beaucarnes
beaucarnes / getCommentsFromPlaylist.js
Last active March 15, 2017 14:07
Google App Script to get a daily e-mail of all new comments from a specific YouTube playlist.
function myFunction() {
var playlistID = "[PLALIST ID GOES HERE]"
var APIKey = "[GET AN API KEY FROM GOOGLE TO GO HERE]"
var toEmail = "[E-MAIL OF COMMENTS WILL BE SENT TO THIS ADDRESS]"
var channelIds = [];
var message = "";
var totalPlaylistViews = 0;
var TIME_LENGTH = 60 * 60 * 1000 * 24.5; // Will get all comments from the last 24.5 hours
var scriptProperties = PropertiesService.getScriptProperties();
@beaucarnes
beaucarnes / play_method-game_of_life.js
Last active September 28, 2017 06:37
Part of the code for my game of life React project.
play = () => {
let g = this.state.gridFull;
let g2 = arrayClone(this.state.gridFull);
for (let i = 0; i < this.rows; i++) {
for (let j = 0; j < this.cols; j++) {
let count = 0;
if (i > 0) if (g[i - 1][j]) count++;
if (i > 0 && j > 0) if (g[i - 1][j - 1]) count++;
if (i > 0 && j < this.cols - 1) if (g[i - 1][j + 1]) count++;
@beaucarnes
beaucarnes / score_bowling.js
Last active December 30, 2017 18:44
score bowling
class Game {
constructor() {
this.frames = [];
}
getFrames() {
return this.frames;
}
score() {
title minutes views
React State Management (P5D58) - Live Coding with Jesse 8 826
React Infinite Scroll (P5D57) - Live Coding with Jesse 23 1166
Working with React Components Part 2 (P5D56) - Live Coding with Jesse 19 726
Coding for a Swedish Startup - a day in the life of Amber Wilkie 9 2744
Working with React Components (P5D55) - Live Coding with Jesse 2 1162
Basic CSS Styling Part 2 (P5D54) - Live Coding with Jesse 45 1704
Writing Secure JavaScript 24 3265
Learn HTML5 - full course with code samples 52 11540
Basic CSS Styling (P5D53) - Live Coding with Jesse 39 2522
@beaucarnes
beaucarnes / scrimba.js
Created December 5, 2018 13:08
Add casts to playlist in Scrimba.
const fetch = require('node-fetch');
var scimbaList = [
["cJkqwhd", "Import a Default Export"],
["cnVnkhZ", "Create an Export Fallback with export default"],
["cLDNvhP", "Use * to Import Everything from a File"],
["cggGNub", "Use export to Reuse a Code Block"],
["cBWq6T9", "Understand the Differences Between import and require"],
["cWpbKHb", "Use getters and setters to Control Access to an Object"],
["cG7W6T6", "Use class Syntax to Define a Constructor Function"],
@beaucarnes
beaucarnes / vector_subs.py
Last active January 7, 2019 20:02
Makes Vector thank subscribers to the Robot Family YouTube channel.
#!/usr/bin/python
import httplib2
import os
import sys
import unicodedata
import threading
import time
import anki_vector
import React from 'react';
import { BrowserRouter as Router, Route } from "react-router-dom";
import "bootstrap/dist/css/bootstrap.min.css";
function App() {
return (
<Router>
<div className="container">
Hello World
</div>
<Navbar />
<br/>
<Route path="/" exact component={ExercisesList} />
<Route path="/edit/:id" component={EditExercise} />
<Route path="/create" component={CreateExercise} />
<Route path="/user" component={CreateUser} />
import React from 'react';
import "bootstrap/dist/css/bootstrap.min.css";
function App() {
return (
<div className="container">
Hello World
</div>
);
}
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
export default class Navbar extends Component {
render() {
return (
<nav className="navbar navbar-dark bg-dark navbar-expand-lg">
<Link to="/" className="navbar-brand">ExcerTracker</Link>
<div className="collpase navbar-collapse">