This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function countLetters(string) { | |
var splitString = string.split(''); | |
var store = {}; | |
splitString.forEach(function(val, index){ | |
if (val in store && val !== ' ') { | |
store[val]++; | |
} else { | |
store[val] = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//simple but handy!! | |
background: #3b5998 url("/img/facebookIcon.png") no-repeat 93% 12px/17.5px 35px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#taskSortable").children(); | |
var patchList = []; | |
taskList.each(function(){ | |
var $this = $(this); | |
var item = { resource_uri : "/api/task-adventure/"+$this.attr("id")+"/", | |
order : $this.index()} | |
patchList.push(item); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
type: "get", | |
// url: window.mlg_api_url + "session/?series__pro__id="+ window.pro.id +"&limit=1&format=json", | |
url: window.mlg_api_url + "session/?series__pro__id="+ window.pro.id +"&limit=1"+ "&series__startDate__gte=" + moment().format('YYYY-MM-DD[T]hh:mm:ss') + "&format=json", | |
dataType: 'json', | |
accepts: 'Application/json', | |
contentType: "application/json", | |
headers: {"x-mlg-api" : "apikey " + window.mlg_api_hash }, | |
crossDomain: 'true', | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
success: function( json ) { | |
window.sessions = json; | |
for (var i = 0; i < window.sessions.objects.length; i++) { | |
window.events = []; | |
window.events.push({ | |
start: window.sessions.objects[i].startDateTime, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mlgGetCoreList () { | |
var cores = ''; | |
$.ajax({ | |
type: "GET", | |
url: 'http://qa.mylittlegolfer.com/prolibapi/v1/core/?format=json', | |
dataType: "json", | |
// data: { | |
// action: "mlg_get_core_list", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Craig Kahle 2014 | |
* Crispy Interactive | |
*/ | |
$MLG_API_URL = "http://qa.mylittlegolfer.com"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
### This would go in the English ./index.php | |
// If browser language is Turkish or if there is a cookie saying you prefer | |
// the Turkish version, we will redirect you to /tr/. | |
if (strpos($_SERVER['HTTP_ACCEPT_LANGUAGE'], 'tr') || (isset($_COOKIE['winmation-lang']) && $_COOKIE['winmation-lang'] === 'tr')) { | |
setcookie("winmation-lang", 'tr', time()+3600*24*365*10); //expire in 10 years | |
// header('Location: http://www.winmation-tr.com/tr/'); | |
} | |
// If you got to the English version by clicking 'english' from |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
//initialize valiadation | |
$(".private").validationEngine(); | |
$(".private input").focus(function(){ | |
$(this).validationEngine('hide'); | |
}) |