Skip to content

Instantly share code, notes, and snippets.

View itzsaga's full-sized avatar
🍕

Seth itzsaga

🍕
View GitHub Profile

Keybase proof

I hereby claim:

  • I am itzsaga on github.
  • I am setha (https://keybase.io/setha) on keybase.
  • I have a public key whose fingerprint is 3F1A 1D8D 3533 F0AF EDE9 4042 1D20 E84A 8069 F2E4

To claim this, I am signing this object:

@itzsaga
itzsaga / arrowFunction.js
Created February 28, 2017 04:11
Basic arrow function example
var regularFunction = function() {
console.log('I was called!')
}
var arrowFunction = () => {
console.log('I was called, too!')
}
regularFunction() // 'I was called!'
arrowFunction() // 'I was called, too!'
@itzsaga
itzsaga / detect_and_find.rb
Last active March 3, 2017 19:09
#detect and #find do the same thing
(1..10).detect { |i| i % 5 == 0 and i % 7 == 0 } #=> nil
(1..100).find { |i| i % 5 == 0 and i % 7 == 0 } #=> 35
@itzsaga
itzsaga / ttt_ternary_problem.rb
Created March 3, 2017 19:10
A problem trying to figure out how to get my ternary to pass tests
# This is passing tests
if draw?(board)
puts "Cats Game!"
else
puts "Congratulations #{winner(board)}!"
end
# This is not passing tests
draw?(board) ? puts "Cats Game!" : puts "Congratulations #{winner(board)}!"
@itzsaga
itzsaga / ttt_ternary_solution.rb
Created March 3, 2017 19:10
The solution to my ternary problem
puts draw?(board) ? "Cats Game!" : "Congratulations #{winner(board)}!"
@itzsaga
itzsaga / fluid_images_and_media.css
Last active March 5, 2017 03:44
Quick CSS code for all media to be fluid.
img, table, form, input, video, audio, iframe {
width: 100%;
max-width: 100%;
}
@itzsaga
itzsaga / multi_column_mobile_up.css
Created March 5, 2017 05:16
An example of multi-column executed in Mobile Up design.
.column {
width: 100%;
float: none;
}
@media only screen and (min-width: 600px) {
.column {
width: 33.333%;
float: left;
}
@itzsaga
itzsaga / wrapper_mobile_up.css
Last active March 5, 2017 05:16
An example of Mobile Up design with the wrapper class.
.wrapper {
width: 90%;
}
@media only screen and (min-width: 980px) {
.wrapper {
width: 960px;
}
}
var katzDeliLine = [];
function currentLine(x) {
var line = []
if (x.length === 0) {
return "The line is currently empty."
} else {
for(var i = 0; i < x.length; i++) {
line += (i + 1) + ". " + x[i] + ", "
}
katz_deli = []
def line(x)
line_array = []
if x.length == 0
puts "The line is currently empty."
else
x.each.with_index(1) do |name, index|
line_array.push("#{index}. #{name}")
end