Skip to content

Instantly share code, notes, and snippets.

View ezos86's full-sized avatar

Eric Cavazos ezos86

View GitHub Profile
@ezos86
ezos86 / country-drop-down.html
Created August 19, 2013 18:44
Country Drop down List (countryCodeAlpha2) for forms.
<select name="countryCodeAlpha2" class="countryCodeAlpha2">
<option value ="null">Choose a Country</option>
<option value ="AF">Afghanistan</option>
<option value ="AX">Åland</option>
<option value ="AL">Albania</option>
<option value ="DZ">Algeria</option>
<option value ="AS">American Samoa</option>
<option value ="AD">Andorra</option>
<option value ="AO">Angola</option>
<option value ="AI">Anguilla</option>
@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 / scroll-fixed-nav.html
Created August 12, 2013 20:19
Nav Bar Mid-page - scroll and then fixed at top of page.
<!DOCTYPE>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<title></title>
</head>
<body>
<div style="height:3000px; position:relative; margin-top:150px; float:left;">
<span id="subnav" style="background-color:#000; height:20px; color:#fff; width:100%; float:left;">hold this</span>
</div>
@ezos86
ezos86 / Checkbox-Examples.markdown
Created December 18, 2014 08:28
Checkbox Examples

Checkbox Examples

This shows how to make fun checkboxes using Font Awesome and basic css.

A Pen by ezos86 on CodePen.

License.

@ezos86
ezos86 / contnt.html
Created August 26, 2013 07:51
Corner Up Shadow Technique - CSS
<div class="effect3" style="margin:20px;">
<img class="effect3" src="http://0777.ir/img/lndl.png"
original-src="http://pearlsquirrel.com/profilethumbnails/$thumbnail"
width="180" height="180" alt="PearlSquirrel"/>
</div>
@ezos86
ezos86 / jquery-no-method-error.js
Created August 19, 2013 18:42
jQuery Variable Error - Object has no method '.val()' or any other method. - it normally results from a Global variable error. Example VS below
var country = $('.countryCodeAlpha2');
var x = country.val();
console.log(x);
VS
var country = $('.countryCodeAlpha2').val;
console.log(country);
@ezos86
ezos86 / jquery-ajax-submit.js
Created August 6, 2013 05:47
Jquery Ajax Submit to API Example with Complete PostBack
$.ajax({
type: 'GET',
url: reportsUrl,
beforeSend : function(xhr) {
var base64 = Base64.encode(username + ":" + password);
xhr.setRequestHeader("Authorization", "Basic " + base64);
},
contentType: 'plain/text',
xhrFields: {
withCredentials: true
@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 = 'ericc@qpme.com';
$subject = 'QPME Feedback From Customer Terminal';
$headers = 'From: website@qpme.com' . "\r\n" .
'Reply-To: webmaster@qpme.com' . "\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){