Skip to content

Instantly share code, notes, and snippets.

View AaronGoldsmith1's full-sized avatar
🎯
Focusing

Aaron Goldsmith AaronGoldsmith1

🎯
Focusing
  • Los Angeles, CA
View GitHub Profile
from src.index import store
class Reservation:
id = 1
def __init__(self, guest, room, start_day, end_day):
self.id = Reservation.id
self.guest = guest
self.room = room
function loop1(){
return new Promise((resolve, reject) => {
for (var i = 1; i <= 100; i++) {
console.log('loop1 =>', i);
}
resolve();
})
}
@AaronGoldsmith1
AaronGoldsmith1 / countdown.md
Last active November 28, 2016 23:34
Countdown timer
function updateTime(){
  var clock = $("#clock");
  var currentTime = moment().utcOffset('-05:00');
  var startOfDay = moment("9:30am", "H:mmA").utcOffset('-05:00');
  var endOfDay = moment("11:30pm", "H:mmA").utcOffset('-05:00');
    if(currentTime > startOfDay && currentTime < endOfDay){
      clock.show();
      clock.html(endOfDay.countdown(currentTime).toString());
    }else{

clock.html("Guessing is Closed");

@AaronGoldsmith1
AaronGoldsmith1 / Project 2 code snippet.md
Last active November 4, 2016 21:41
Project 2 code snippet

This section of code uses the HTTParty gem to query the bitcoin blockchain using the Blockchain.info API.
I had a lot of fun working with this gem, and I'm looking forward to working with other APIs in the future! I would also like to find a way to use the Blockchain.info to calculate the total transcation fees associated with an individual bitcoin addres.

  begin

@response = HTTParty.get('https://blockchain.info/address/'+@address.loc+'?format=json')

This function initiates the winning indication by flashing all the colored sections four times, and is probably the most interesting bit of code in the app.

//all colored section flash 4 times in a row to signify the user has won
function userWin() {
   winFlashes++;
  for(var i = 0; i < 4; i++){
    $colors.each(function(){
      var color = $(this);  //referencing all colored sections
@AaronGoldsmith1
AaronGoldsmith1 / aaron.md
Created October 14, 2016 18:27
Project 1 Code Review Gist

This function initiates the winning indication by flashing all the colored sections four times.

//all colored section flash 4 times in a row to signify the user has won
function userWin() {
   winFlashes++;
  for(var i = 0; i < 4; i++){
    $colors.each(function(){
 var color = $(this); //referencing all colored sections
This is a sample Gist!