Skip to content

Instantly share code, notes, and snippets.

@EdConnell
EdConnell / d3.css
Last active August 29, 2015 14:01
d3.js learning script to be modified for populating x,y values for evehelper rails app
#map{
border: 1px solid black;
}
#systems {
display: inline-block;
vertical-align: text-top;
margin: -785px 0 0 10px;
height: 800px;
overflow: scroll;
@EdConnell
EdConnell / seedscript.rb
Last active August 29, 2015 13:57
Test script made for learning EVE Online API
require 'nokogiri'
require 'open-uri'
require 'sqlite3'
require 'csv'
BASE_URL = "https://api.eveonline.com/"
JUMP_URL = "map/Jumps.xml.aspx"
KILLS_URL = "map/Kills.xml.aspx"
SOV_URL = "map/Sovereignty.xml.aspx"
<html>
<head>
<title>Post-It Board</title>
<link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body id="board">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
/*
* What are the objects in this exercise?
* What are their properties and methods?
* How do your objects interact with their respective DOM elements?
*/
var GroceryList = function () {
this.items = [];
this.totalPrice = 0;
};
GroceryList.prototype.addItem = function (item) {
//------------------------------------------------------------------------------------------------------------------
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here.
//------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------
// DRIVER CODE: Do **NOT** change anything below this point. Your task is to implement code above to make this work.
//------------------------------------------------------------------------------------------------------------------
@EdConnell
EdConnell / index.html
Last active December 19, 2015 07:29 — 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>
/* Here is your chance to take over Socrates!
Spend 10 minutes on each of the following hacks to the socrates website.
Enter them in the console to make sure it works and then save
your results here.
Choose a new pair for each. Add your names to the section you complete.
*/
$(document).ready(function() {
$("form").on("submit", function(event) {
event.preventDefault();
var randomRoll = Math.floor(Math.random() * 6) + 1;
$.post('/rolls', {value: randomRoll}, function(server_response) {
// var roll = $(server_response).find("#die").html();
var data = $(server_response).find('#die')
console.log(server_response);
$('#die').html(data);
@EdConnell
EdConnell / gist:5733018
Last active December 18, 2015 05:29
Sudoku shizzle
board = [
[0,9,6,0,4,0,0,0,1],
[1,0,0,0,6,0,0,0,4],
[5,0,4,8,1,0,3,9,0],
[0,0,7,9,5,0,0,4,3],
[0,3,0,0,8,0,0,0,0],
[4,0,5,0,2,3,0,1,8],
[0,1,0,6,3,0,0,5,9],
[0,5,9,0,7,0,8,3,0],
[0,0,3,5,9,0,0,0,7]]