Skip to content

Instantly share code, notes, and snippets.

View field2's full-sized avatar

Ben Dunkle field2

View GitHub Profile
To retrieve the number of visits over the last month using Google Analytics, you can modify the PHP code to make use of the Google Analytics Reporting API. Here's an example of how you can achieve this:
### 1. Set up Google Analytics:
1. Make sure your website is configured with Google Analytics, and you have the tracking code.
2. Enable the Google Analytics Reporting API for your project and obtain the API credentials (client ID, client secret, etc.).
### 2. Install the Google API PHP Client Library:
You can use Composer to install the library. Run the following command in your project directory:
@media (orientation: landscape) {
}
@field2
field2 / index.html
Created November 4, 2020 16:22
Lab 8: Ghost
<h1>Ghost</h1>
<h2>A simple spelling game</h2>
<p>Here's a simple game that'll pit you against your friends for the title of the sole survivor. It starts off easy, but with each turn it gets more and more cutthroat. Will you survive until the end, or will you end up as a
GHOST?</p>
<a href="https://www.figma.com/proto/LYr7utVoR3iEzqwVuHj6bd/Project-2-dma217?node-id=1%3A2&viewport=596%2C486%2C1.19429349899292&scaling=scale-down">Try it now for free!</a>
@field2
field2 / scroller.js
Created September 14, 2012 11:22
Scroller
<script type="text/javascript">
// When ready...
window.addEventListener("load",function() {
// Set a timeout...
setTimeout(function(){
// Hide the address bar!
window.scrollTo(0, 1);
}, 0);
});