Skip to content

Instantly share code, notes, and snippets.

@laurenancona
laurenancona / GoogleAppsScript2GitHub.gs
Created October 26, 2017 21:05 — forked from mhawksey/GoogleAppsScript2GitHub.gs
Example script that demonstrates how you can commit files to Github using Google Apps Script. If copying into a script project remembers to add a oAuth2 library https://github.com/googlesamples/apps-script-oauth2. More info in this post https://mashe.hawksey.info/?p=17293
/*
To use you need to create an application on Github at https://github.com/settings/developers
The callback in this needs to be set to https://script.google.com/macros/d/{SCRIPT ID}/usercallback
Where {SCRIPT ID} is the ID of the script that is using this library. You can find your script's ID in the Apps Script code editor by clicking on the menu item "File > Project properties".
In this example code I've stored the apllicaitons clientId and clientSecret in the Script Properties:
- git_clientId
- git_clientSecret
@laurenancona
laurenancona / JSON with JS.md
Created March 22, 2017 15:28
Access local JSON data with Javascript

What

An updated guide/collection of guides on how to access JSON data with JavaScript

Original Question on Stack Exchange.


Example 1

For reading the external Local JSON file (data.json) using java script

@laurenancona
laurenancona / loadtest.py
Created October 7, 2016 21:16 — forked from mjumbewu/loadtest.py
Simple load tester that continuously sends GET requests to a list of URLs for a given duration of time. Requires python libraries click and requests.
#!/usr/bin/env python
from __future__ import print_function, division
import click
import csv
from datetime import timedelta
from itertools import cycle
from queue import Queue
import requests
@laurenancona
laurenancona / json-ld-gtm.html
Last active September 28, 2016 21:10 — forked from chrisgoddard/json-ld-gtm.html
JSON-LD GTM Tag
<script>
(function(){
var data = {
"@context": "http://schema.org",
"@type": "BlogPosting",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": {{Page URL}}
},
"headline": {{SCHEMA - Article Headline}},
{
"version": 8,
"name": "Dark",
"metadata": {
"mapbox:autocomposite": true,
"mapbox:type": "default",
"mapbox:groups": {
"1444934828655.3389": {
"name": "Aeroways",
"collapsed": true
@laurenancona
laurenancona / .block
Created July 2, 2016 18:56 — forked from mbostock/.block
Calendar View
license: gpl-3.0
height: 2910
border: no
@laurenancona
laurenancona / README.md
Last active August 29, 2015 14:19 — forked from kerryrodden/.block

This example shows how it is possible to use a D3 sunburst visualization (partition layout) with data that describes sequences of events.

A good use case is to summarize navigation paths through a web site, as in the sample synthetic data file (visit_sequences.csv). The visualization makes it easy to understand visits that start directly on a product page (e.g. after landing there from a search engine), compared to visits where users arrive on the site's home page and navigate from there. Where a funnel lets you understand a single pre-selected path, this allows you to see all possible paths.

Features:

  • works with data that is in a CSV format (you don't need to pre-generate a hierarchical JSON file, unless your data file is very large)
  • interactive breadcrumb trail helps to emphasize the sequence, so that it is easy for a first-time user to understand what they are seeing
  • percentages are shown explicitly, to help overcome the distortion of the data that occurs wh
@laurenancona
laurenancona / OCP-html-tpl-php
Created August 14, 2012 18:35
html.tpl.php OCP
<?php
/**
* @file
* Default theme implementation to display the basic html structure of a single
* Drupal page.
*
* Variables:
* - $css: An array of CSS files for the current page.
* - $language: (object) The language the site is being displayed in.