Skip to content

Instantly share code, notes, and snippets.

View codenamejason's full-sized avatar
:octocat:
Buidling 🫠

<jaxcoder /> codenamejason

:octocat:
Buidling 🫠
View GitHub Profile
@codenamejason
codenamejason / style.php
Last active August 29, 2015 14:08
stylePHP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
ob_start ("ob_gzhandler");
@codenamejason
codenamejason / disco_type.js
Last active August 29, 2015 14:16
Modify specified document types in links with a new class
$('a[href]').each(function() {
if((C = $(this).attr('href').match(/[.](pdf|doc|docx|xls)$/))) {
$(this).addClass(C[1]);
}
});
var cubeToMove : CubeMover;
function Start() {
cubeToMove = GameObject.Find("Mover").GetComponent(CubeMover);
}
function OnMouseDown () {
transform.localScale.y = 0.2;
cubeToMove.Move();
cubeToMove.speed -= 0.1;
@codenamejason
codenamejason / UserCreateFirebase.js
Last active July 5, 2017 22:06
Create user if does not exist already
function go() {
var userId = prompt('Username?', 'Guest');
var userData = { name: userId };
tryCreateUser(userId, userData);
}
var USERS_LOCATION = 'https://<Firebase URL>.com/users';
function userCreated(userId, success) {
if (!success) {
@codenamejason
codenamejason / background.css
Last active August 29, 2015 14:16
Change background image with button
#imgDiv {
width: 400px;
height: 400px;
background-image: url('http://placehold.it/400.png&text=New_Image/464545/e743c3');
}
@codenamejason
codenamejason / SiteStatus.js
Last active August 29, 2015 14:16
Check site status
var xhr = new XMLHTTPRequest();
xhr.open("GET", " web address", false);
xhr.send();
console.log(xhr.satus);
@codenamejason
codenamejason / constructor.js
Last active August 29, 2015 14:16
Function Constructor
this.prototype = { constructor: this };
var myObject = maker(f, l, m, c, s);
var myObject = maker({
first: f,
last: l,
middle: m,
state: s,
city: c
});
@codenamejason
codenamejason / isItArray.js
Last active August 29, 2015 14:16
Is it an array?
var isArray = function(value) {
return value && typeof value === 'object' && value.constructor === Array;
};
@codenamejason
codenamejason / passCheck.js
Created March 3, 2015 01:29
Password check
ths.method = function(passChk) {
if (passChk == 1234)
return method;
else
return "Wrong Password";
};
@codenamejason
codenamejason / myAge.py
Created March 3, 2015 04:06
Age In Days
age = input
days_in_year = 365.25
days_alive = age * days_in_year
print days_alive