Skip to content

Instantly share code, notes, and snippets.

Avatar

Reme Le Hane RemeJuan

View GitHub Profile
@RemeJuan
RemeJuan / form_validation.js
Created Aug 26, 2014
Very basic form validation for jQeury, only useful if you do not want to use wbshims to pollyfill older browsers and simply nee to validate if a field has a value.
View form_validation.js
//Basic custom form validation
$('#formSave').on('click', function() {
$('input[data-required="true"]').each(function(){
if($(this).val() === '') {
$(this).addClass('required').val('This field is required');
}
});
if (cfarray.length === 0) {
$('#selectedResults').addClass('required').text('This field is required')
@RemeJuan
RemeJuan / HTML5_Blank.html
Last active Aug 29, 2015
HTML5 Blank HTML template
View HTML5_Blank.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name=viewport content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Untitled Document</title>
</head>
<body>
</body>
@RemeJuan
RemeJuan / contents.css
Last active Aug 29, 2015
Default CSS File
View contents.css
/***********************************************************************************************/
/*
Contents
*/
/***********************************************************************************************/
@RemeJuan
RemeJuan / getQueryVAriables.js
Created Sep 15, 2014
Get query variables from url string with javascript
View getQueryVAriables.js
//Get query variables from URL string
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("="); if(pair[0] == variable) {
return pair[1];
}
}
@RemeJuan
RemeJuan / ajax_search.js
Last active Aug 29, 2015
AJAX search query returning JSON data from DB to populate UL
View ajax_search.js
//Function to handle database search and process results
function getCustomers(searchQuery) {
$.ajax({
type: 'POST',
url: '/com/cfcs/SearchServices.cfc?method=searchCustomerByName&customerName=' + searchQuery + '&returnFormat=json',
datatype: 'json',
cache: false,
success: function(response)
{
var searchResults = response.DATA,
@RemeJuan
RemeJuan / browser_test.js
Last active Aug 29, 2015
Detect browser version using HTTP headers, add a class to the body tag as well as set a variable.
View browser_test.js
//Check browser version and apply classes to body where applicable
var body = document.getElementsByTagName('body')[0],
browserName,
browserVersion,
userAgent = navigator.appVersion.toLowerCase();
if (userAgent.indexOf("msie 8.") !== -1)
{
body.classList.add('ie8');
browserName = 'ie';
@RemeJuan
RemeJuan / wercker.yml
Created Mar 30, 2016
Complete docker sample file for automated deployment to digital ocean.
View wercker.yml
box: node
build:
steps:
- npm-install
deploy:
steps:
- script:
name: install nodemon
@RemeJuan
RemeJuan / style.css
Created Apr 4, 2016
Better responsive table
View style.css
@media only screen and (max-width: 800px) {
.enhanced-responsive-table {
table, thead, tbody, th, td, tr {
display: block;
}
thead tr {
position: absolute;
top: -9999px;
left: -9999px;
View keybase.md

Keybase proof

I hereby claim:

  • I am RemeJuan on github.
  • I am remejuan (https://keybase.io/remejuan) on keybase.
  • I have a public key whose fingerprint is 9FE2 6A96 E3E3 34A0 E323 8ED6 A932 9EF4 E20C E8E9

To claim this, I am signing this object:

@RemeJuan
RemeJuan / main.html
Last active Nov 15, 2016
Aurelia: First Impressions #1
View main.html
<template>
<!--Importing a component into a template-->
<require from="component/component"></require>
<require from="other-component/other-component.html"></require>
<!--Displaying/rendering the imported component.-->
<component></component>
<other-component data-bind="stuff"></other-component>
</template>