Skip to content

Instantly share code, notes, and snippets.

View powerc9000's full-sized avatar
🧺

Clay Murray powerc9000

🧺
View GitHub Profile
@powerc9000
powerc9000 / present.md
Last active December 18, 2015 10:39
My git presentation
@powerc9000
powerc9000 / no-jquery1.js
Created June 19, 2013 22:45
Querying without jquery
//getting something by id
var element = document.getElementById("idName"); //remeber to not use a "#"
//getting something by class
var elements = document.getElementsByClassName("className");//remeber not to user a "."
//Notice that getElementsByClassName returns a collection not just a singular item. and although it is array like. it isn't an array
@powerc9000
powerc9000 / cacher.js
Created July 10, 2013 18:38
Loads images and caches them in local storage. If the image exists in localStorage it loads it from the cache. NOTE: Because of cross origin policy it will only cache images belonging to the same domain as the webpage.
//include your images like thus
//<img data-src="">
(function(){
var cache = document.querySelectorAll("[data-src]");
var c = document.createElement("canvas");
var ctx = c.getContext("2d");
for(var i=0; i<cache.length; i++){
var el = cache[i];
var url = el.getAttribute("data-src");
@powerc9000
powerc9000 / head-on.js
Last active December 30, 2015 05:39
Head-on.js from bullet-dodge2 to work with in jsfiddle without requirejs
(function(window, undefined){
"use strict";
var headOn = (function(){
var vectorProto;
var headOn = {
groups: {},
_images: {},
fps: 50,
imagesLoaded: true,
@powerc9000
powerc9000 / raycast.js
Last active August 29, 2015 13:56
raycaster it's slow will speed it up
(function(window, undefined){
"use strict";
var headOn = (function(){
var vectorProto;
var headOn = {
groups: {},
_images: {},
fps: 50,
imagesLoaded: true,
@powerc9000
powerc9000 / CS1415Lab14.cpp
Created April 18, 2014 01:53
Lab 14 is CS1415 I have to tutor and it will be nice to have the code for people to look at
//Clay Murray
//CS 1415
//A cool bank simulation with a queue
#include <iostream>
#include <queue>
#include <stdlib.h>
#include <time.h>
using namespace std;
int randomWait();
<html>
<head>
<title>Some page</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<p id="hello" class="hi">Hello World</p>
<div class="hi hide-contain">Hey!
<div class="hide hi">
  • Super Suits
  • Mt. Paradise
  • Suave Collection
  • Gangster Spy
  • Pixel collector Paradise
  • Bang Paradise
  • Rabid Heist
  • Pixel Spy
  • Pixel Mission
  • Casino Spy
@powerc9000
powerc9000 / react-talk.md
Last active November 30, 2015 03:52
My talk.

Hello everyone,

My name is Clay Murray I am a developer at Unicity International This talk is to teach you about using react specifically building Isomorphic websites using react.

The problem. In frameworks like Angular you build your HTML completely on the client side. While there are many upsides to this technique there are a few downsides Time between page download and render Because it is all being constructed client side, it can take a moment to create the page for the user. SEO, because indexers, at least in the past, didn't run javascript on the page, you missed out on important SEO information

@powerc9000
powerc9000 / Vectors.cpp
Created March 15, 2016 01:34
Some vectors
struct vector3D {
float x;
float y;
float z;
}
//now we can make some vector functions
vector3D add(vector3D left, vector3D right){
vector3D result = {};
result.x = left.x + right.x;