Skip to content

Instantly share code, notes, and snippets.

View daniel-c05's full-sized avatar

Daniel Alvarado daniel-c05

View GitHub Profile
@daniel-c05
daniel-c05 / BitmapHelper.java
Created October 19, 2012 15:10
Helper class to download an image from a specified URL
public class BitmapHelper {
class DownloadImageFromURL extends AsyncTask<String, String, Bitmap> {
private final WeakReference<ImageView> imageViewReference;
String mUrl;
private int mWidth = 0;
private int mHeigth = 0;
private boolean isThumbnail = false;
@daniel-c05
daniel-c05 / BloggerResponse.json
Created September 11, 2013 04:18
Examples of a JSON response from blogger, and the custom classes implemented on an Android application for use with the Ion library.
{
"kind": "blogger#postList",
"nextPageToken": "CgkIChiAkceVjiYQ0b2SAQ",
"prevPageToken": "CgkIChDBwrK3mCYQ0b2SAQ",
"items": [
{
"kind": "blogger#post",
"id": "7706273476706534553",
"blog": {
"id": "2399953"
@daniel-c05
daniel-c05 / filter-mcc-acounts-by-label.js
Created August 3, 2014 04:26
Filter MCC Accounts by Label
var LABEL = "Your_label";
function main () {
var accountIterator = MccApp.accounts()
.withCondition("LabelNames CONTAINS '" + LABEL + "'")
.get();
Logger.log("Total Number of accounts under label (via totalNumEntities): "
+ accountIterator.totalNumEntities());
@daniel-c05
daniel-c05 / perform-basic-bid-management.js
Last active April 9, 2019 16:19
AdWords Scripts - Perform Basic Bid Management
var workingDateRange = "LAST_14_DAYS";
function main() {
lowerBidsToTopKeywords();
raiseBidsToMidPositionKeywords();
raiseBidsToLowPositionKeywords();
}
@daniel-c05
daniel-c05 / account-health-check.js
Last active August 29, 2015 14:10
AdWords Scripts - Account Health Check
// EMAIL FIELDS
var _mailto = 'YOUR_EMAIL';
var _subject = 'Account Review Needed - ';
var _htmlBody = '<h1>Account Review Required</h1>';
var _isEmailRequired = false;
//PARAMETERS CHECKED
var _impressionsTreshold = 100;
var _clickTreshold = 10;
var _conversionTreshold = 2;
@daniel-c05
daniel-c05 / minimize-over-delivery.js
Last active June 4, 2016 01:22
AdWords Scripts - Minimize Overdelivery
//Edit this based on the max amount you want to spend on a given day.
var maxSpend = 1000;
function main () {
var currentAccount = AdWordsApp.currentAccount();
var stats = currentAccount.getStatsFor("TODAY");
var cost = stats.getCost();
Logger.log("Account has spent " + cost + " so far.");
if (cost > maxSpend) {
campaign.pause();
@daniel-c05
daniel-c05 / evaluate-ad-text-line-performance.js
Last active April 9, 2019 16:19
AdWords Scripts - Evaluate Ad Text Line Performance
// Comma-separated list of recipients. Comment out to not send any emails.
var RECIPIENT_EMAIL = 'YOUR_EMAIL';
// URL of the default spreadsheet template. This should be a copy of http://goo.gl/pxaZio
var SPREADSHEET_URL = 'SPREADSHEET_URL';
/**
* This script computes an Ad performance report
* and outputs it to a Google spreadsheet
*/