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
public static void get(Context context, int idStatus, final int id, final SuccessListener successListener, final ErrorListener errorListener) { | |
String url = "some_url_to_get_json"; | |
ARequest.get(context, url, | |
new AResponse.SuccessListener() { | |
@Override | |
public void onResponse(Object response) { | |
JSONArray jsonArray = null; | |
try { | |
JSONObject jsonObject = new JSONObject(response.toString()); | |
if (jsonObject.getJSONObject("meta").getInt("code") == 200) { |
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
@Override | |
public boolean onTouchEvent(MotionEvent event) { | |
if (mTopCard == null) { | |
return false; | |
} | |
if (mGestureDetector.onTouchEvent(event)) { | |
return true; | |
} | |
Log.d("Touch Event", MotionEvent.actionToString(event.getActionMasked()) + " "); | |
final int pointerIndex; |
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
public static string SomenteNumeros(string texto = null) | |
{ | |
if (texto == null) return texto; | |
Regex re = new Regex("[0-9]"); | |
StringBuilder s = new StringBuilder(); | |
foreach (Match m in re.Matches(texto)) | |
{ | |
s.Append(m.Value); | |
} | |
return s.ToString(); |
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
public function sendEmail($email, $subject, $html, $text) | |
{ | |
$sesClient = SesClient::factory(array( | |
'credentials' => array( | |
'key' => 'YOURKEY', | |
'secret' => 'YOURSECRET', | |
), | |
'region' => 'us-east-1', | |
'version' => '2010-12-01' | |
)); |
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
public function sendCampaignMailSes() | |
{ | |
if ($this->date_sent != null) { | |
// Log!!! | |
$this->showLog("Already sent"); | |
return; | |
} | |
if ($this->date_sending != null) { | |
$this->showLog("Already sending! - since: " . $this->date_sending); | |
return; |
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
global $wp_subscribe_reloaded; | |
echo "Subscribe old comments<br><br>"; | |
// Get all comments on database | |
$comments = get_comments(array('type'=>'comment')); | |
$added=0; | |
echo "Comments: ".var_dump(count($comments))."<br>"; | |
foreach ($comments as $comment){ | |
$postId=$comment->comment_post_ID; | |
$email=$comment->comment_author_email; | |
if (strpos(email,'YOUR_EMAIL')!==false) continue; |
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
componentDidMount() { | |
window.addEventListener("resize", ()=> { | |
this.updateDimensions(); | |
}); | |
this.updateDimensions(); | |
} | |
updateDimensions() { | |
let w = window, |
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 React from 'react'; | |
import * as PropTypes from "prop-types"; | |
import Dialog from 'material-ui/Dialog'; | |
import FlatButton from 'material-ui/FlatButton'; | |
import Snackbar from 'material-ui/Snackbar'; | |
import TextField from 'material-ui/TextField'; | |
export default class Context extends React.Component { |
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
fucntion ucWords (str) { | |
str = str.trim(); | |
str = str.toLowerCase().replace(/^[\u00C0-\u1FFF\u2C00-\uD7FF\w]|\s[\u00C0-\u1FFF\u2C00-\uD7FF\w]/g, function (letter) { | |
return letter.toUpperCase(); | |
}); | |
return str; | |
} |
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
/** | |
* Return the name and surname | |
* "Tiago Gouvêa de Oliveira" will return "Tiago Gouvea" | |
* @author TiagoGouvea | |
* @param name | |
* @returns String | |
*/ | |
function nameSurname (name) { | |
name = name.trim(); | |
if (!name) return ''; |
OlderNewer