Skip to content

Instantly share code, notes, and snippets.

View ultratoast's full-sized avatar

ultratoast ultratoast

View GitHub Profile
@ultratoast
ultratoast / jquery-carousel
Last active February 11, 2023 08:45
Simple carousel script with infinite loop
@ultratoast
ultratoast / gist:5bfcacfc25dc3add8bee
Created October 23, 2014 17:06
JQuery for Tumblr Theme - Grab most recent Image from Photo Post
//insert at the bottom of your theme
$(document).ready(function () {
var imagePosts = $('.type_photo')
if (imagePosts.length > 0 && imagePosts[0]) {
var theImage, img,
thePost = $(imagePosts)[0],
postImages = $(thePost).find('img');
if (postImages.length > 0 && postImages[0]) {
theImage = $(postImages)[0],
img = $(theImage).attr('src')
@ultratoast
ultratoast / binarysearch.js
Created October 23, 2014 04:55
Javascript Binary Search for Integers
function compareNum(a,b) {
if (a < b) {
return -1
}
if (a > b) {
return 1
}
if (a == b) {
return 0
}