Skip to content

Instantly share code, notes, and snippets.

View pedrogrande's full-sized avatar

Pete Argent pedrogrande

View GitHub Profile
name = "Hans"
greeting = "Good evening"
sum = 5 + 200 + -10
time = Time.now
animals = ['cat', 'dog', 'cow', 'elephant']
puts greeting + ' ' + name
puts "5 + 200 - 10 = #{sum}"
puts "The first animal in the list is #{animals[0]}"
puts "5 > 7 = #{ 5 > 7 }"
puts "Is 'hello' the same as 'HELLO'? #{'hello' == 'HELLO'}"
puts "You enter a room with two doors. Do you open Door 1 or 2?"
print "> "
door = gets.chomp
if door == "1"
puts "You won $5000!"
elsif door == "2"
puts "You stare into the endless abyss :("
else
def hello
puts = "Hello Leia"
end
hello
def hello(name)
result = "Hello " + name
return result
end
puts hello("Leia")
#!/usr/bin/python
L = [9,1,1,2,2,2,2,2,3,4,4,5,6,6,6,4,4,4,4,4,7,9,4,9]
length_of_array = len(L)
print("Length of array: %d" % length_of_array)
# temp_con {}
con = {}
array_of_con = []
i = 0
length_of_array = len(L)
con = {}
array_of_con = []
i = 0
k = 0
while (i < (length_of_array - 1)):
first_item = L[i]
second_item = L[i+1]
con[k] = con.get(k, 1)
if first_item == second_item:
0x65b9ff557d727de2fbaa8bda5625b6fe2d937479
0x52Db1fa050ba9534478B000772106328E06C814E
<script>
var stripe = Stripe('<%= Rails.application.secrets.stripe_pk %>');
var elements = stripe.elements();
var style = {
base: {
color: '#303238',
fontSize: '16px',
lineHeight: '48px',
fontSmoothing: 'antialiased',