Skip to content

Instantly share code, notes, and snippets.

View IronistM's full-sized avatar
🏗️
Under construction

Manos Parzakonis IronistM

🏗️
Under construction
View GitHub Profile
require(fpp)
# Please make sure at least v3.10 of the forecast is loaded
# before running these examples.
# Three examples
beer <- aggregate(ausbeer)
plot(beer)
plot(a10)
plot(taylor)
@IronistM
IronistM / save an R dataframe with the name specified by a string.r
Created November 29, 2013 13:13
save an R dataframe with the name specified by a string
# Create explicit data frames and TS objects given a list
market.list<- c("GR","CY","RU","RO","PL","UA","ROW")
for (i in market.list) {
tmp <- subset(data,Market==i)
tmp<-ts(tmp) # It's a timeseries afterall...
# Let's save the data somewhere so we don't get back all the time
filename <- paste("data_", i, sep="")
assign(filename, tmp)
save(filename, file=paste(filename, ".rda",sep=""))
}
@IronistM
IronistM / facebookads.gs
Last active April 10, 2018 17:28 — forked from chipoglesby/facebookads.gs
Pull Facebook Advertising Metrics into Google Sheets
var SPREADSHEET_URL = "";
function facebookSpend() {
var ss = SpreadsheetApp.openByUrl(SPREADSHEET_URL);
var sheet = ss.getSheetByName('facebook');
var values = [];
Utilities.sleep(1000);
var fullUrl = 'https://graph.facebook.com/v2.3/act_xxx/stats?access_token=xxx';
var fetchRequest = UrlFetchApp.fetch(fullUrl);
var results = JSON.parse(fetchRequest.getContentText());
Logger.log(results.spent/100);
@IronistM
IronistM / track_email_opens.js
Last active January 26, 2018 16:45
How to Track Gmail Messages with Google Analytics modified for Universal Analytics tracking. You will need to copy this spreadsheet http://goo.gl/Tk1nR8 and then open Tools > Script Editor to replace the existing code or simply add the /* Universal Analytics Tracking */ part
/*
Email Tracking with Google Analytics
====================================
Written by Amit Agarwal on 09/24/2013
Tutorial: http://labnol.org/?p=8082
YouTube : http://youtu.be/9T_EqwQnZY0
Support : http://twitter.com/labnol
@IronistM
IronistM / Termux.Jupyter.md
Created January 3, 2018 12:26 — forked from pcornier/Termux.Jupyter.md
Install Jupyter with Numpy, SciPy, Pandas and Matplotlib
pkg install apt-transport-https curl gnupg pkg-config clang
pkg install freetype freetype-dev libpng libpng-dev libzmq-dev libzmq

mkdir $PREFIX/etc/apt/sources.list.d

echo "deb [trusted=yes] https://its-pointless.github.io/files/ termux extras" > $PREFIX/etc/apt/sources.list.d/pointless.list

curl -O https://its-pointless.github.io/pointless.gpg
@IronistM
IronistM / 3G-fraction-1s-example.sql
Created December 14, 2017 16:06 — forked from RatulSaha/3G-fraction-1s-example.sql
Chrome User Experience Report Analyzed with Google BigQuery
SELECT
SUM(fcp.density)
FROM
`chrome-ux-report.chrome_ux_report.201710`,
UNNEST(first_contentful_paint.histogram.bin) AS fcp
WHERE
origin = "https://www.google.co.in"
AND effective_connection_type.name = "3G"
AND fcp.END <= 1000
library(ggplot2)
library(ggmap)
library(plyr)
library(grid)
library(gridExtra)
# read in cleaned up data
dat <- read.table("quakes.dat", header=TRUE, stringsAsFactors=FALSE)
# map decimal magnitudes into an integer range
@IronistM
IronistM / dynamically_changing_SQL_statement.qvs
Created November 11, 2013 10:42
This code sets variables to define a time period (previous calendar month) dynamically changing the SQL statement sent to source
let vLastMonth = Year(AddMonths(now(),-1)) & '-' & num(month(addmonths(now(),-1)),'00') & '-01';
// This gets the first of the previous month
let vThisMonth = Year(now()) & '-' & num(month(now()),'00') & '-01';
// This gets the first of the current month
ODBC CONNECT TO MyDSN; // Change to your database
LOAD *;
SQL SELECT
set RecCount = 500000000; // Number of records to generate
Data:
load
chr(round(25 * rand() + 65)) & chr(round(25 * rand() + 65)) & chr(round(25 * rand() + 65)) as Customer, // Customer name between AAA and ZZZ
chr(round(25 * rand() + 65)) as Product, // Product name between A and Z
round(3 * Rand() + 2008) as Year, // Year between 2008 and 2011
round(1000000 * Rand()) as Actual, // Actual Revenue between 0 and 1,000,000
round(1000000 * Rand()) as Target // Target Revenue between 0 and 1,000,000
autogenerate(RecCount);

Keybase proof

I hereby claim:

  • I am ironistm on github.
  • I am ironistm (https://keybase.io/ironistm) on keybase.
  • I have a public key ASCZ7BiBXH6ory2tLDfrhyxX7Cpsmr-M5343erNPTYUqlQo

To claim this, I am signing this object: