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 ( $, window, undefined ) { | |
// undefined is used here as the undefined global variable in ECMAScript 3 is | |
// mutable (ie. it can be changed by someone else). undefined isn't really being | |
// passed in so we can ensure the value of it is truly undefined. In ES5, undefined | |
// can no longer be modified. | |
// window and document are passed through as local variables rather than globals | |
// as this (slightly) quickens the resolution process and can be more efficiently | |
// minified (especially when both are regularly referenced in your plugin). |
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
/** | |
* substitui strings >> replaceAll(str, '.', ':'); | |
* @param string : string utilizada | |
* @param token : termo buscado | |
* @param newtoken : termo irá substituir | |
*/ | |
function replaceAll(string, token, newtoken) { | |
while (string.indexOf(token) != -1) { | |
string = string.replace(token, newtoken); | |
} |
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
/** | |
* POPULA COMBOBOX CIDADES | |
* @param UF : string do estado 'RJ' | |
* @param CIDID : ID da cidade | |
* @param obj_target : ID do select da cidade | |
* Ex: <input type="text" name="cep" id="cep" data-uf-id="uf" data-cidade-id="cidade" data-bairro-id="bairro" data-logradouro-id="logradouro" /> | |
*/ | |
function populaCidades(UF, CIDID, obj_target) { | |
myAj = $.ajax({ | |
type: "POST", |
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
$newdb = new wpdb('root', '', 'sig001', 'localhost'); | |
$l = $newdb->get_results("SELECT * FROM sig_contents WHERE content_type = 'sigsystem' ORDER BY title"); | |
d($newdb->show_errors()); | |
if($l){ | |
foreach($l as $r){ | |
d($r->title); | |
} | |
} |
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
angular.module('myMdl', []).config(['$httpProvider', function($httpProvider) { | |
$httpProvider.responseInterceptors.push([ | |
'$q', '$templateCache', 'activeProfile', | |
function($q, $templateCache, activeProfile) { | |
// Keep track which HTML templates have already been modified. | |
var modifiedTemplates = {}; | |
// Tests if there are any keep/omit attributes. | |
var HAS_FLAGS_EXP = /data-(keep|omit)/; |
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
# fork and clone | |
git clone <repo name> | |
# keep synk with remote origin | |
git remote add origin https://<repo name> | |
# fetch updates from upstream | |
git checkout master | |
git fetch upstream | |
git merge upstream/master |
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.send(); | |
* | |
* Usage: Ajax.send('my-handler', {"data": "value"}, ajaxurl).then(function(response){ //... }); | |
* | |
* Ajax handler to send messages to WordPress AJAX API | |
*/ | |
(function ($, window, document, undefined) { | |
window.Ajax = (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
/** | |
* WelAjaxForm | |
* | |
* Example: | |
* $('.news-signin').WelAjaxForm({ | |
action: 'form_newsletter_signin', // string | false | |
fields: [ | |
{'name' : {'selector': '#field_name_ft', validation: 'required'}}, | |
{'email' : {'selector': '#field_email_ft', validation: 'required'}} | |
], |
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
html { | |
font-size: calc(12px + 9 * ( (100vw - 420px) / 860)); | |
} | |
@media screen and (max-width: 420px) { | |
html { | |
font-size: 12px; | |
} | |
} |
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 | |
$location = get_field('location'); | |
if( !empty($location) ): | |
?> | |
<a href="http://www.google.com/maps/preview#!q=<?=urlencode( $location['address'] )?>"> | |
<img src="http://maps.googleapis.com/maps/api/staticmap?center=<?php echo $location['lat']; ?>,<?php echo $location['lng']; ?>&zoom=15&format=png&sensor=false&size=397x297&maptype=roadmap&visual_refresh=true&style=visibility:off&style=feature:road|element:geometry|visibility:simplified&style=feature:landscape|element:geometry|visibility:simplified&style=element:labels|visibility:on&markers=color:red|<?php echo $location['lat']; ?>,<?php echo $location['lng']; ?>"/> | |
</a> | |
<?php endif; ?> |
OlderNewer