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
<div class="clearfix"> | |
<nav class="wp-pagenavi"> | |
<?php | |
global $wp_query; | |
$big = 999999876; //necessario numero inteiro foda | |
echo paginate_links( array( | |
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), | |
'format' => '?paged=%#%', | |
'current' => max( 1, get_query_var('paged') ), |
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
setTimeout | |
( | |
StartWatching, | |
100 | |
); | |
function StartWatching() | |
{ | |
$("#someDiv").bind('DOMSubtreeModified',function() { | |
alert('modificou'); |
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
class Api::ApiController < ActionController::Base | |
prepend_before_filter :get_auth_token | |
respond_to :json | |
public | |
def restrict_access | |
api_key = User.find_by_authentication_token(params[:auth_token]) | |
head :unauthorized unless api_key | |
end | |
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
string recebeJSON = ""; | |
using (var client = new WebClient()) | |
{ | |
recebeJSON = client.DownloadString("URL do JSON"); | |
} | |
//transforma a string em objeto | |
JObject _recebeJSON = JObject.Parse(recebeJSON); |
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
string UrlAplicacao = Request.Url.Scheme+"://"+Request.Url.Authority + Request.ApplicationPath; |
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 Facebook; | |
.... | |
public ActionResult actionCallback() | |
{ | |
try | |
{ | |
if (String.IsNullOrEmpty(Request["code"])) | |
throw new Exception("Não foi possível efetuar login na aplicação."); |
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
config.action_mailer.smtp_settings = { | |
:address => "mail.adrianogodoy.com", | |
:port => 587, | |
:domain => "adrianogodoy.com", | |
:user_name => "sender@adrianogodoy.com", | |
:password => "senha", | |
:authentication => :login, | |
:enable_starttls_auto => false | |
} | |
config.action_mailer.raise_delivery_errors = 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
.Where(u => Regex.IsMatch(u.Nome, busca, RegexOptions.IgnoreCase)) |
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 | |
function iced_chart_display($atts, $content = null) | |
{ | |
global $chart_id; | |
wp_enqueue_script('google-visualization', 'http://www.google.com/jsapi', array('jquery'), '1.0', true); | |
wp_enqueue_script('iced-visualization', plugins_url('iced-visualization.js', __FILE__), array('google-visualization'), '1.0', true); | |
$type = $atts['type']; | |
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
HttpContext.Response.ContentType = "application/vnd.ms-excel"; | |
HttpContext.Response.AddHeader("content-disposition", "attachment;filename=nome_arquivo-" + DateTime.Now.ToString("yyyy-MM-dd_HH-mm") + ".xls"); | |
// HttpContext.Response.Charset = "utf-8"; | |
HttpContext.Response.ContentEncoding = System.Text.Encoding.GetEncoding("windows-1250"); |