Skip to content

Instantly share code, notes, and snippets.

Stella Miranda stellamiranda

Block or report user

Report or block stellamiranda

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View obi-wan
Food:
Twice at day.
Obi doesn't eat much some times, that is normal, ideally will eat 1/2 cup of food on the morning, half on the afternoon. But being realistic, he eats less that it, unless he has been at the office running all day.
Pee:
2 or 3 times at day, depending on activity and water drink. If he stays at home, he could be just doing it at morning and evening. If going to the office, he can drink more water based on more activity and needs to be taken out just for pee after lunch.
Poo:
View test.json
{
"Abkhazia": {
"cn_name": "",
"flag": "https://upload.wikimedia.org/wikipedia/commons/2/27/Flag_of_Abkhazia.svg",
"flag_thumb": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/27/Flag_of_Abkhazia.svg/200px-Flag_of_Abkhazia.svg.png"
},
"Afghanistan": {
"cn_name": "",
"flag": "https://upload.wikimedia.org/wikipedia/commons/9/9a/Flag_of_Afghanistan.svg",
"flag_thumb": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Flag_of_Afghanistan.svg/150px-Flag_of_Afghanistan.svg.png"
@stellamiranda
stellamiranda / kth_to_last_node.rb
Created Feb 28, 2018
You have a linked list ↴ and want to find the kth to last node.
View kth_to_last_node.rb
#Write a method kth_to_last_node() that takes an integer kk and the head_node of a singly-linked list, and returns the kkth to last node in the list.
def kth_to_last_node(k, head)
if k < 1
raise ArgumentError, "Impossible to find less than first to last node: #{k}"
end
# STEP 1: get the length of the list
# start at 1, not 0
View Delete Duplicate Emails - SQL
Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id.
+----+------------------+
| Id | Email |
+----+------------------+
| 1 | john@example.com |
| 2 | bob@example.com |
| 3 | john@example.com |
+----+------------------+
Id is the primary key column for this table.
View staircase.rb
# Challenge: Staircase - HakerRank
# Author: Stella Miranda
# Consider a staircase of size n = 4:
#
##
###
####
View mini-max_sum.rb
# Challenge: Mini-Max Sum - HakerRank
# Author: Stella Miranda
# Given five positive integers, find the minimum and maximum values that can be calculated by summing exactly four of the five
# integers. Then print the respective minimum and maximum values as a single line of two space-separated long integers.
# Input Format
# A single line of five space-separated integers.
# Constraints
View birthday_cake_candles.rb
# Challenge: Birthday Cake Candles - HakerRank
# Author: Stella Miranda
# Colleen is turning n years old! Therefore, she has n candles of various heights on her cake, and candle i has height height_i .
# Because the taller candles tower over the shorter ones, Colleen can only blow out the tallest candles.
# Given the height_i for each individual candle, find and print the number of candles she can successfully blow out.
# Input Format
# The first line contains a single integer, n , denoting the number of candles on the cake.
# The second line contains n space-separated integers, where each integer i describes the height of candle i.
View time_conversion.rb
# Challenge: Time Conversion - HakerRank
# Author: Stella Miranda
# Given a time in 12-hour AM/PM format, convert it to military (24-hour) time.
# Note:
# Midnight is 12:00:00AM on a 12-hour clock, and 00:00:00 on a 24-hour clock.
# Noon is 12:00:00PM on a 12-hour clock, and 12:00:00 on a 24-hour clock.
# Input Format:
View c055d3d3dab9-stdouterr.log
15:48:06 web.1 | started with pid 8
15:48:06 nginx.1 | started with pid 9
15:48:07 web.1 | [8] Puma starting in cluster mode...
15:48:07 web.1 | [8] * Version 3.4.0 (ruby 2.3.0-p0), codename: Owl Bowl Brawl
15:48:07 web.1 | [8] * Min threads: 2, max threads: 5
15:48:07 web.1 | [8] * Environment: production
15:48:07 web.1 | [8] * Process workers: 2
15:48:07 web.1 | [8] * Preloading application
15:48:07 web.1 | I, [2016-04-25T15:48:07.999602 #8] INFO -- : (0.000706s) SET standard_conforming_strings = ON
15:48:08 web.1 | I, [2016-04-25T15:48:08.000556 #8] INFO -- : (0.000662s) SET client_min_messages = 'WARNING'
View cms log - April_25_2016
-------------------------------------
/var/log/eb-docker/containers/eb-current-app/327732b9c3ac-stdouterr.log
-------------------------------------
15:19:09 worker.1 | [ActiveJob] [ImportUplynkAssetsJob] [f6b6eadb-c73a-40db-878a-cebc76870f96] Sequel::Postgres::Database (5.1ms) SELECT * FROM "videos" WHERE ("external_id" = 'c6cb142531504be995391f04bb5deab0') LIMIT 1
15:19:09 worker.1 | [ActiveJob] [ImportUplynkAssetsJob] [f6b6eadb-c73a-40db-878a-cebc76870f96] Sequel::Postgres::Database (1.3ms) SELECT * FROM "videos" WHERE ("external_id" = 'edd791844cf14cf9a14cbf8a56e7ac7d') LIMIT 1
15:19:09 worker.1 | [ActiveJob] [ImportUplynkAssetsJob] [f6b6eadb-c73a-40db-878a-cebc76870f96] Sequel::Postgres::Database (1.2ms) SELECT * FROM "videos" WHERE ("external_id" = '4449a43e970e434a8e39e40e709e8f98') LIMIT 1
15:19:09 worker.1 | [ActiveJob] [ImportUplynkAssetsJob] [f6b6eadb-c73a-40db-878a-cebc76870f96] Sequel::Postgres::Database (1.2ms) SELECT *
You can’t perform that action at this time.