Skip to content

Instantly share code, notes, and snippets.

View Absoludacris06's full-sized avatar

Nicholas Saldivar Absoludacris06

  • @opmotor
View GitHub Profile

Keybase proof

I hereby claim:

  • I am absoludacris06 on github.
  • I am nsaldivar (https://keybase.io/nsaldivar) on keybase.
  • I have a public key ASBA_Wqiks6lgZk228rrR38Qo1x7wcCPu7jSngCwv6_B0go

To claim this, I am signing this object:

class List
attr_reader :title, :tasks
def initialize(title, tasks = [])
@title = title
@tasks = tasks
end
def add_task(task)
tasks << task
@Absoludacris06
Absoludacris06 / form-validator.js
Last active December 22, 2015 09:48 — forked from ksolo/form-validator.js
Form Validation
$(function(){
$("form").on("submit", function(e) {
e.preventDefault();
$("#errors li").remove();
var errors = [];
var email = $(this).find("input[name=email]").val();
var password = $(this).find("input[name=password]").val();
if (!checkEmail(email)) {
errors.push("Must be a valid email address.");
}
$(document).ready(function () {
var rollThatShit = function(){
return Math.floor(Math.random() * 6) + 1;
};
$('#vegas').submit(function(e){
e.preventDefault();
$.ajax({
url: this.action,
@Absoludacris06
Absoludacris06 / index.html
Last active December 22, 2015 04:08 — forked from dbc-challenges/index.html
DBC Phase 2 Practice Assessment Part 3
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css">
</head>
@Absoludacris06
Absoludacris06 / debug_read_error.rb
Created August 6, 2013 02:11
Debugging: Read the Error
# Exercise 1
def mean(numbers)
sum = numbers.inject(:+)
return sum / numbers.length
end
# This will throw an error. Change this line so that it works.
sample_avg = mean([5, 3, 6, 10])