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 submit example */ | |
$(function(){ | |
// example 1 (only POST) | |
$('#form-id').submit(function(e){ | |
e.preventDefault(); | |
var frm = this; | |
var ajax_opts = {}; | |
ajax_opts.url = $(frm).attr('action'); |
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 | |
defined('BASEPATH') OR exit('No direct script access allowed'); | |
class MY_Loader extends CI_Loader { | |
/** | |
* Database Loader [modified to synchronize mysql database timezone] | |
* @author Sujeet <sujeetkv90@gmail.com> | |
* | |
* @param mixed $params Database configuration options |
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
/* using connection pool (recommended) */ | |
var mysql = require('mysql'); | |
var log = require('./mylogger'); | |
var local_context = this; | |
var SimpleQueryException = function (message) { | |
this.name = 'SimpleQueryException'; | |
this.message = message; |
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
/** | |
* jQuery.deparam() | |
* @author Sujeet Kumar <sujeetkv90@gmail.com> https://github.com/sujeetkv | |
* | |
* @param string queryString (params string) | |
* @param boolean coerce (force type conversion) | |
*/ | |
(function ($) { | |
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 | |
/** | |
* Card class | |
*/ | |
class Card | |
{ | |
private $deck = null; | |
private $pos = null; | |
private $suit = ''; | |
private $rank = ''; |
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
/** | |
* jsonPrettify | |
* | |
* @param {String|Object} json Json object or string | |
* @param {Boolean} preformatted Preformatted for html | |
* @param {Boolean} colored Colored for preformatted | |
* | |
* @return {String} | |
*/ | |
var jsonPrettify = function (json, preformatted, colored) { |
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 ($) { | |
$.fn.stickyScroll = function () { | |
var $this = this; | |
var scrollbar = $('<div id="fixed-scrollbar"><div></div></div>').appendTo($(document.body)); | |
scrollbar.hide().css({ | |
overflowX: 'auto', | |
width: '100%', | |
position: 'fixed', | |
bottom: 0 |
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
from itsdangerous import ( | |
TimedJSONWebSignatureSerializer as TokenSerializer, | |
BadSignature, SignatureExpired | |
) | |
class AuthToken(object): | |
"""AuthToken class""" | |
SECRET_KEY = 'secret-key' |
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 ($) { | |
/** | |
* jQuery plugin to get sum of selected input values | |
* Usage syntax: | |
* $('selector').sum() | |
* $('selector').sum(initial_value) | |
* $('selector').sum(parse_type) | |
* $('selector').sum(parse_type, initial_value) | |
*/ | |
$.fn.sum = function (parse_type, initial_value) { |
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
import re | |
import json | |
OP_STACK = list() | |
ELEM_STACK = list() | |
COMP_STACK = list() | |
OP_MONGO_MAP = dict({ | |
'AND': '$and', | |
'OR': '$or', |
OlderNewer