Skip to content

Instantly share code, notes, and snippets.

View ezos86's full-sized avatar

Eric Cavazos ezos86

View GitHub Profile
@ezos86
ezos86 / mail-function.php
Created August 6, 2013 05:27
PHP Mail Example
<?php
$name = $_POST['feedback-name'];
$email = $_POST['feedback-email'];
$message = $_POST['feedback-box'];
$to = '[email protected]';
$subject = 'QPME Feedback From Customer Terminal';
$headers = 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
@ezos86
ezos86 / db-input-form.php
Created August 2, 2013 07:48
This is a basic Database Insert
<!DOCTYPE>
<html>
<head>
<title></title>
</head>
<body>
<form action="db-insert.php" method="post">
<label for="firstName">First Name:</label>
<input id="firstName" name="firstName" value="" />
<br>
@ezos86
ezos86 / basic-auth-api-get-call.js
Created July 28, 2013 21:38
Basic API Get Request Javascript only --> Replace username and password --> Use Base64.js file with this
function make_base_auth(user, pass) {
var tok = user + ':' + pass;
var hash = Base64.encode(tok);
return "Basic " + hash;
}
function api_call(){
var xhr;
// code for IE 10, Firefox, Chrome, Opera, Safari
if (window.XMLHttpRequest){
@ezos86
ezos86 / base64-encoding.js
Created July 28, 2013 20:59
Base64 Encoding
var Base64 = {
// private property
_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
// public method for encoding
encode : function (input) {
var output = "";
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
var i = 0;
@ezos86
ezos86 / base-api-get-request.html
Created July 28, 2013 20:44
Basic API Get Request Javascript (no jquery)
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script>
function api_call(){
var xhr;
// code for IE 10, Firefox, Chrome, Opera, Safari
if (window.XMLHttpRequest){
@ezos86
ezos86 / example-img-hover-page.html
Last active December 20, 2015 08:19
Image Hover JS that Blows up Image
<div class="img-flat_rate" style="float:left; margin-right:20px">
<a class="img-big" href="example-big.png"><img src="example-small.png" alt="Flat Rate Example (iPhone)"/></a>
</div>
<script type="text/javascript">
$('.img-big').imgPreview();
</script>
@ezos86
ezos86 / jquery-api-get.js
Created July 28, 2013 18:49
Jquery .getJSON Example
function api_get (){
var url = "https://api.qpme.com/1.6/locations";
$.getJSON(url, function(data){
var size = data.length;
for(i = 0; i < size; i++){
$('#mydiv').append(data[i].address + ' - ' + data[i].name + '<br>');
console.log(data[i]);
}
});
}