Skip to content

Instantly share code, notes, and snippets.

View admariner's full-sized avatar

Periklis Papanikolaou admariner

  • admariner
  • Thessaloniki
View GitHub Profile
@admariner
admariner / install_packages.R
Created July 7, 2021 03:36 — forked from hannesdatta/install_packages.R
automatically install all R packages used in a project (scans all source code files)
################################
# FIND AND INSTALL R PACKAGES #
# #
# #
# Searches source code for #
# references to packages, #
# and installs all #
# uninstalled packages. #
# #
# Put this script in the #
@admariner
admariner / download_from_dropbox.py
Created July 7, 2021 03:34 — forked from hannesdatta/download_from_dropbox.py
Python script to download entire folder/directory structure from a (shared) Dropbox folder to a local computer
################################################################
# DOWNLOAD ENTIRE FOLDER STRUCTURE FROM DROPBOX TO LOCAL DRIVE #
################################################################
# Instructions:
# (1) install dropbox API using pip
# > pip install dropbox
# (2) Create application to make requests to the Dropbox API
# - Go to: https://dropbox.com/developers/apps
@admariner
admariner / async-defer-module.md
Created July 7, 2021 00:44 — forked from jakub-g/async-defer-module.md
async scripts, defer scripts, module scripts: explainer, comparison, and gotchas

<script> async, defer, async defer, module, nomodule, src, inline - the cheat sheet

With the addition of ES modules, there's now no fewer than 24 ways to load your JS code: (inline|not inline) x (defer|no defer) x (async|no async) x (type=text/javascript | type=module | nomodule) -- and each of them is subtly different.

This document is a comparison of various ways the <script> tags in HTML are processed depending on the attributes set.

If you ever wondered when to use inline <script async type="module"> and when <script nomodule defer src="...">, you're in the good place!

Note that this article is about <script>s inserted in the HTML; the behavior of <script>s inserted at runtime is slightly different - see Deep dive into the murky waters of script loading by Jake Archibald (2013)

Tiny Content Framework

About the project

This is a tiny content strategy framework focused on goals, messages, and branding. This is not a checklist. Use what you need and scrap the rest. Rewrite it or add to it. These topics should help you get to the bottom of things with clients and other people you work with.

Give me feedback on Twitter (@nicoleslaw) or by email ([email protected]).

Contents

@admariner
admariner / airtable_helper.py
Created May 30, 2021 02:12 — forked from KalebNyquist/airtable_helper.py
Simple Download/Upload of Airtable Data into/from Python using Airtable API
import requests
import json
import pandas as pd
def airtable_download(table, params_dict={}, api_key=None, base_id=None, record_id=None):
"""Makes a request to Airtable for all records from a single table.
Returns data in dictionary format.
Keyword Arguments:
product_id="online:en:US:XX-XXXXX-XXXX-XX"
merchant_id = XXXXXXX
product = service.products().get(
merchantId=merchant_id, productId=product_id).execute()
#partial example product result
"""{'adwordsRedirect': 'https://www.website.com/product/product_url?code=XXX',
'ageGroup': 'adult',
'availability': 'in stock',
from shopping.content import common
# Authenticate and construct service.
service, config, _ = common.init([], __doc__)
#Example Output
#Using service account credentials from /root/shopping-samples/content/service-account.json.
#Merchant Center XXXXXXX is not an MCA.
#Website for Merchant Center XXXXXXX: https://www.sitename.com
MAX_PAGE_SIZE = 10
MAX_RESULT = 20
merchant_id = XXXXXXX
#execute list API
request = service.products().list(
merchantId=merchant_id, maxResults=MAX_PAGE_SIZE)
#iterate over results and stop at MAX_RESULT products
count = MAX_RESULT
@admariner
admariner / Hour&DayOfWeek_Script
Created March 3, 2021 07:55 — forked from RitwikGA/Hour&DayOfWeek_Script
Analyze the Adwords Dayparting Performance Through Automated Scripts
/* Adwords Hour&DayOfWeek Analysis
* Description: Analyze the Adwords Dayparting performance.
* Author:RitwikGA
* Version 1.1
* DigiShuffle.com
*/
function main()
{
@admariner
admariner / Adwords City Optimizer
Created March 3, 2021 07:53 — forked from RitwikGA/Adwords City Optimizer
Adwords Performing vs Underperforming cities - Reduce your CPA - 2
/* Adwords City Optimizer
* Description: Analyze the Adwords City performance.
* Author:RitwikGA
* Version 1.1
* Copyright (c) 2016 Licensed under GPL licenses.
* Mail: [email protected]
*/
function main()
{