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 / index.html
Created June 4, 2017 10:28
Linked List
<img src="https://people.engr.ncsu.edu/efg/210/s99/Notes/LLdefs.gif" alt="" width="600px"/>
@beaucarnes
beaucarnes / play_method-game_of_life.js
Last active June 3, 2024 15:48
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 / index.css
Created June 11, 2018 12:15
From 'Learn HTML5' course
@import url(https://use.fontawesome.com/releases/v5.0.6/css/all.css);
#home {
--first-color: #674ea7;
--second-color: #f4e767;
--light-gray: lightgray;
}
#next {
--first-color: tomato;
--second-color: deepskyblue;
@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
@beaucarnes
beaucarnes / vector_message_control.py
Created January 8, 2019 18:48
Code to control my Vector through YouTube live stream.
#!/usr/bin/env python
from time import sleep
import anki_vector
from youtubechat import YoutubeLiveChat, get_live_chat_id_for_stream_now
livechat_id = get_live_chat_id_for_stream_now("oauth_creds")
chat_obj = YoutubeLiveChat("oauth_creds", [livechat_id])
import React from 'react';
import "bootstrap/dist/css/bootstrap.min.css";
function App() {
return (
<div className="container">
Hello World
</div>
);
}