Skip to content

Instantly share code, notes, and snippets.

View TravisL12's full-sized avatar
🪲
Smokes if you got'em.

Travis Lawrence TravisL12

🪲
Smokes if you got'em.
View GitHub Profile
$(document).ready(function(){
$('form').on('submit',function(e){
e.preventDefault();
$.ajax({
type:'post',
url:'/rolls'
}).done(function(data){
$('#die').html('<img src=' + data + ".png>");
@TravisL12
TravisL12 / gist:5332269
Last active December 15, 2015 22:19
Calculate the sum of prime numbers below a maximum number of integers (max_prime). This is in response to the Project Euler Problem 10: http://projecteuler.net/problem=10 This problem states to find the sum of all prime numbers less than 2,000,000.
max_prime = 51
array = Array.new(max_prime) { |i| i }
not_primes = []
primes = []
array.each do |i|
if i > 1 && i <= (max_prime ** 0.5)
0.upto(max_prime) do |j|
sieve = i**2 + (j * i) # Sieve_of_Eratosthenes algorithm to find non-primes
@TravisL12
TravisL12 / TRLscript.js
Created September 22, 2012 00:13
An attempt at JS
var blogs = [
{"Title" : "Rebuilding shit",
"Post" : "I think progress has been made\. I think progress has been made\. I think progress has been made\. I think progress has been made\. I think progress has been made\. I think progress has been made\. I think progress has been made\. I think progress has been made\. ",
"Footer" : "September 3rd 2012"
},
{"Title" : "Second post containting stuff",
"Post" : "Practice makes perfect\. Practice makes perfect\. Practice makes perfect\. Practice makes perfect\. Practice makes perfect\. Practice makes perfect\. " ,
"Footer" : "October 2nd 2012"