Skip to content

Instantly share code, notes, and snippets.

// Function to convert number of seconds into Hours::Minutes::Seconds
function minutesSeconds(s){
return(s-(s%=60))/60+(9<s?':':':0')+s;
}
// The Main Function
function start(){
// Current Page
var currentURL = window.location.href;
javascript:function minutesSeconds(s){return(s-(s%=60))/60+(9<s?':':':0')+s}function start(){var currentURL=window.location.href;var bar=document.getElementsByClassName("ytp-progress-bar")[0];var seconds=bar.getAttribute("aria-valuenow");var secondsInMS=minutesSeconds(seconds);var URL=currentURL+"?t="+seconds;var obsidianFormat="["+secondsInMS+"]("+URL+")";navigator.clipboard.writeText(obsidianFormat);null;var elemDiv=document.createElement('div');elemDiv.innerHTML="<h1 style='font-size:100px; color:white; text-align:center; margin-top:2em;'>"+secondsInMS+"</h1>";elemDiv.style.cssText='position:absolute;width:100%;height:100%;opacity:0.8;z-index:1000;background:#000;';document.body.appendChild(elemDiv);setTimeout(function(){elemDiv.style.display="none"},600)}start();
// Add in the servo library
#include <Servo.h>
// Create the servo object
Servo servo1;
// Store the 2 positions of the disk rotation
int intPos = 0;
int secPos = 180;

Keybase proof

I hereby claim:

  • I am borkdoy on github.
  • I am borkdoy (https://keybase.io/borkdoy) on keybase.
  • I have a public key ASCJF7hCN5ssTgLWTl0Nl70w2HKxPUDCVqhUpCFnUbfdCwo

To claim this, I am signing this object:

// Set the starting scene
var scene = 0
// Setup some global variables
var alphabet = []
var currentLetterToFind
var positions
// Store the frames as the game is played to be used as a timer
var numberOfFrames = 0
var clickDistance = dist ( mouseX, mouseY, currentLetterToFind[1], currentLetterToFind[2] )
if (clickDistance < 50 ){
var currentLetterIndex = alphabet.indexOf(currentLetterToFind)
var nextLetterIndex = currentLetterIndex + 1
}
if (alphabet.indexOf(currentLetterToFind) > i){
fill( 220 , 220, 220 )
}
else{
// Assign the stored color value
fill( alphabet[i][4] )
}
function drawCirclePattern() {
// Creates the dots that surround the canvas
var numberOfRows = 19
var numberOfColumns = 38
var radius = 14
var marginX = 34
var marginY = 38
var xPosition = 20
var yPosition = 16
var rotation = 0
var allCoordinates = [];
// Create a row
for ( i = 0; i < rows + 1; i++ ){
// Create a column
for ( j = 0; j < columns + 1 ; j++ ){
rect( j * columnWidth, i * columnHeight, columnWidth, columnHeight )
//create my point
var pointPositionX = random( j * columnWidth + columnWidth, j * columnWidth )
var pointPositionY = random( i * columnHeight + columnHeight, i * columnHeight )
allCoordinates.push( [pointPositionX, pointPositionY] )
for ( i = 0; i < rows + 1; i++ ){
var columnData = []
// Create a column
for ( j = 0; j < columns + 1 ; j++ ){
rect( j * columnWidth, i * columnHeight, columnWidth, columnHeight )
//create my point
var pointPositionX = random( j * columnWidth - columnWidth, j * columnWidth )
var pointPositionY = random( i * columnHeight - columnHeight, i * columnHeight )
columnData.push( [pointPositionX, pointPositionY] )
console.log( columnData )