#Promises Ref
##polyfill A polyfill for ES6-style Promises: https://github.com/jakearchibald/es6-promise
var dateFormat = function () { | |
var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g, | |
timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g, | |
timezoneClip = /[^-+\dA-Z]/g, | |
pad = function (val, len) { | |
val = String(val); | |
len = len || 2; | |
while (val.length < len) val = "0" + val; | |
return val; | |
}; |
//Underscore Underscore.js 1.7.0 - http://underscorejs.org | |
(function(){var n=this,t=n._,r=Array.prototype,e=Object.prototype,u=Function.prototype,i=r.push,a=r.slice,o=r.concat,l=e.toString,c=e.hasOwnProperty,f=Array.isArray,s=Object.keys,p=u.bind,h=function(n){return n instanceof h?n:this instanceof h?void(this._wrapped=n):new h(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=h),exports._=h):n._=h,h.VERSION="1.7.0";var g=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}};h.iteratee=function(n,t,r){return null==n?h.identity:h.isFunction(n)?g(n,t,r):h.isObject(n)?h.matches(n):h.property(n)},h.each=h.forEach=function(n,t,r){if(null==n)return n;t=g(t,r);var e,u=n.length;if(u===+u)for(e=0;u>e;e++)t(n[e] |
<?php | |
$teste= '65sss654-654aaaa'; | |
$teste = preg_replace('/[^1-9]/', '',$teste ); | |
echo $teste; //65654654 |
var Injector = { | |
dependencies: {}, | |
process: function(target) { | |
var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m; | |
var FN_ARG_SPLIT = /,/; | |
var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/; | |
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; | |
var text = target.toString(); |
var main = (function() { | |
'use strict'; | |
var setCallback = function (arg, callback) { | |
if(typeof callback === 'function'){ | |
callback.call(this, arg); | |
} | |
} | |
var setEvent = function(arg){ |
#Promises Ref
##polyfill A polyfill for ES6-style Promises: https://github.com/jakearchibald/es6-promise
function GetAutoComplete(arg, callback){ | |
//your ajax | |
return $.ajax({ | |
url: 'url', | |
type: 'GET', | |
dataType: 'JSON', | |
data: arg, | |
cache: true, | |
success: function(res){ | |
if(typeof callback === 'function'){ |
var regHasQuotes = regex= new RegExp(/[\\"']/g); // if has quotes or double quotes return true | |
var regNotHasQuotes = new RegExp(/[^\\"']/g); //if has quotes or double quotes return false, else, return true | |
var onlyNumbers = var reg = new RegExp('^[0-9]+$'); //if contains int val return true, else return false |
var isNumber = function(num){ | |
var reg = new RegExp('^[0-9]+$'); | |
return reg.test(num); | |
} | |
/** | |
* use class .mascara_numero | |
* define data atribute into selector <imput type="text" data-type="['decimal', 'int', 'string']" data-places="Int"> | |
* data-type: string | |
* data-places: int |
###Previne o fast
git merge --no-ff
Previne o fast foward, de modo que ele matém a referência da arvore ao ralizar o merge
###Previne o commit
git merge --no-commit