Skip to content

Instantly share code, notes, and snippets.

/*
* jQuery v1.9.1 included
*/
(function($) {
$.QueryString = (function(a) {
if (a == "") return {};
var b = {};
for (var i = 0; i < a.length; ++i) {
var p = a[i].split('=');
if (p.length != 2) continue;
red = 255
green = 0
stepSize = 5
array = []
while green < 255
green += stepSize;
if green > 255
green = 255
end
@Tobitron
Tobitron / state_of_matter_test.html
Created March 10, 2016 19:24
State of Matter Test HTML
<html>
<head>
<link href='https://fonts.googleapis.com/css?family=Dosis:400,700' rel='stylesheet' type='text/css'>
<link href="https://s3.amazonaws.com/adsauxfiles/state_of_matter/state_of_matter.css" rel="stylesheet" type='text/css'>
</head>
<body>
<div>
<div class="parent">
<div class="container">
<a href="about:close"><div class="x">x</div></a>
@Tobitron
Tobitron / toucantest.html
Created March 9, 2016 14:23
toucantest
<html>
<head>
<link href='https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz' rel='stylesheet' type='text/css'>
<link href="http://www.tobiaskahn.com/seeds/toucan.css" rel="stylesheet" type='text/css'>
</head>
<body>
<div>
<div class="parent">
<div class="container">
<a href="about:close"><div class="x">x</div></a>
@Tobitron
Tobitron / toucan.html
Created March 8, 2016 22:23
Toucan Interstitial
<html>
<head>
<link href='https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz' rel='stylesheet' type='text/css'>
<link href="http://www.tobiaskahn.com/seeds/toucan.css" rel="stylesheet" type='text/css'>
</head>
<body>
<div>
<div class="parent">
<div class="container">
<a href="about:close"><div class="x">x</div></a>
@Tobitron
Tobitron / seeds.js
Created March 8, 2016 20:37
Seeds Interstitial Javascript
<script>
function inArray(item, array){
var count=array.length;
for(var i=0;i<count;i++) {
if (array[i] === item) {return true;}
}
return false;
}
@Tobitron
Tobitron / gist:8dacfbb6cbedeebef744
Created October 28, 2015 23:21
Uncaught TypeError: window.initMap is not a function
$( document ).ready(function() {
var cityData = 0
$.get("/cities.json", function(data) {
cityData = data
});
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
center: {lat: 10.209, lng: 108},
var loopContent =
'<div id="iw-container">' +
'<div class="iw-title">' + city.name + " " + city.city_review_average + '</div>' +
'<div class="iw-content">' +
'<div class="iw-subTitle">Review</div>' +
city["city_reviews"].forEach(function(review) {
review.description
}); +
'</div>' +
'</div>';
// Trying to hit this route: contest_photo PATCH /contests/:contest_id/photos/:id(.:format) photos#update
$('.submit-button').click( function() {
$.ajax({
url: 'contests/1/photos/1',
type: 'PATCH',
success: function(result) {
// Do I even need this??
}
});
$('.submit-button').click( function() {
$.ajax({
url: 'contests/1/photos/1/edit',
type: 'PATCH',
success: function(result) {
// Do I even need this??
}
});
});