Skip to content

Instantly share code, notes, and snippets.

View DewofyourYouth's full-sized avatar
:octocat:
Pluckin' banjo or crafting a tinfoil hat. Also, sometimes I code. ;)

Jacob E. Shore DewofyourYouth

:octocat:
Pluckin' banjo or crafting a tinfoil hat. Also, sometimes I code. ;)
  • Dew of your Youth
  • Bet Shemesh, Israel
View GitHub Profile
@DewofyourYouth
DewofyourYouth / date_object_snippets.js
Created November 6, 2018 15:36
Some quick code snippets for tutorial on working with the JavaScript date object.
//iterate date
var myDate = new Date();
var dateInMS = myDate.getTime();
// day in milliseconds = 1000 (milliseconds in a second) * 60 (seconds in a minute) * 60 (minutes in an hour) * 24 (hours in a day) = 86400000 (millseconds in a day)
// the getTime() method gets the time in milliseconds since January 1, 1970.
var tomorrow = new Date(datInMS + 86400000);
console.log(myDate);
console.log(tomorrow);
@DewofyourYouth
DewofyourYouth / nazir_schedule.gs
Created November 7, 2018 23:29
A scheduler for studying tractate Nazir
function onEdit(e) {
// Interact with Sheets App
var app = SpreadsheetApp;
// get current active sheet
var activeSheet = app.getActiveSpreadsheet().getActiveSheet();
// gets the amount of blatt in Nazir
var blattInNazir = activeSheet.getRange("B2").getValue();
// Log blattInNazir
Logger.log("There are " + blattInNazir + " blatt in Nazir");
// Example of function
String addNumbers(int num1, int num2){
return('${num1} + ${num2} = ${num1 + num2}');
}
// A basic class w/ attribute
class Person {
String fname;
String lname;
int age;
const object1 = {
'50': 'somestring',
'100': 42,
'25': false
};
var numsArr = [1, 34, 68.5, 33];
// Returns an array of the keys - then maps then to get the values by key
@DewofyourYouth
DewofyourYouth / index.html
Created November 26, 2019 11:12
vue-todo-basic
<div class="wrap">
<div class="jumbotron">
<h1 class="display-2 text-center">Vue Todo</h1>
<h2 class="text-center"> -- Basic ---</h2>
</div>
</div>
<div id="app" class="container">
<h3 class="text-center">Instructions:</h3>
<p class="text-center">
<nav class="navbar" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<a class="navbar-item" href="https://dewofyouryouth.github.io/">
<img src="https://dewofyouryouth.github.io/doyy.png" height="50">
</a>
<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
void main() {
print(tribonacciTime([0, 0, 1], 10));
print(find([1, 3, 4, 5, 7]));
print(find([2, 4, 5, 6]));
}
// Find the outlier
int find(List integers) {
var evens = 0;
for (int ctr = 0; ctr <= 2; ctr++) {
@DewofyourYouth
DewofyourYouth / classy_dart.dart
Created January 7, 2020 18:57
some basic dart stuff
class Person {
String name;
int age;
/// A class for making people. Accepts a [name] and an [age]
Person(String name, int age) {
this.name = name;
this.age = age;
}
}