Skip to content

Instantly share code, notes, and snippets.

View Sufuninja's full-sized avatar

William Campbell Sufuninja

  • Tax Advisors Group, LLC
  • Boerne Texas
View GitHub Profile
// Convert UNIX timestamp to local time
function convertTimestamp(timestamp) {
var d = new Date(timestamp * 1000), // Convert the passed timestamp to milliseconds
yyyy = d.getFullYear(),
mm = ('0' + (d.getMonth() + 1)).slice(-2), // Months are zero based. Add leading 0.
dd = ('0' + d.getDate()).slice(-2), // Add leading 0.
hh = d.getHours(),
h = hh,
min = ('0' + d.getMinutes()).slice(-2), // Add leading 0.
@Sufuninja
Sufuninja / sort.js
Last active August 30, 2015 23:42
Practice functions. A basic rewriting of the .sort() method in JavaScript
/* This is my version of sort. It is cluncky and took me far too
long to complete. But now it works!...Thanks to splice().*/
function sort(array){
var currentLargest = array[0];
// store sorted values to be itterated though if item is < currentLargest
var tempArray = [];
/* Updated final array to be returned. I was not sure if trying to itterate through,
tempArray while changing it, would cause unpredictable results so I tried this.*/
var finalArray = [];
var userTable = {JOHN: "PIZZA", SUE: "LADY", DANNY: "SCIENCE"}
var userName
var password
function _getName() {
userName = prompt("Login:").toUpperCase();
};
function _getPassword() {
password = prompt("Login:").toUpperCase();
<!DOCTYPE html>
<html>
<head>
<meta charset="utf_8">
<title><Will Campbell/#myPage></title>
<!--iframe showing my blog and link atributes-->
<style type="text/css">
iframe {
position: bottom;
@Sufuninja
Sufuninja / IntroducingMichaelBlackard.md
Last active August 29, 2015 14:26
Lesson_1-makerPrep

#Introducing Michael Blackard!

Click here to see Michael's friends

##Bio Q&A

Q. What did you do before comming to MakerPrep?

A. I worked at Blizzard for seven years in customer service.