Skip to content

Instantly share code, notes, and snippets.

Avatar

William Entriken fulldecent

View GitHub Profile
@fulldecent
fulldecent / Google Analytics Experiment Dashboard.php
Last active Oct 24, 2020
Google Analytics dashboard. Shows a lit of all your experiments with Bootstrap 3 and the current progress of those experiments.
View Google Analytics Experiment Dashboard.php
<?php
// Service account code from http://stackoverflow.com/questions/18258593/using-a-service-account-getaccesstoken-is-returning-null
// Analytics code from https://code.google.com/p/google-api-php-client/source/browse/trunk/examples/analytics/simple.php?r=474
require_once 'google-api-php-client/src/Google_Client.php';
require_once 'google-api-php-client/src/contrib/Google_AnalyticsService.php';
// Set your client id, service account name (AKA "EMAIL ADDRESS"), and the path to your private key.
// For more information about obtaining these keys, visit:
// https://developers.google.com/console/help/#service_accounts
@fulldecent
fulldecent / travis-local.md
Created Nov 29, 2017
Run Travis build locally
View travis-local.md

travis-local.md

Preconditions:

  1. POSIX or Windows system
  2. Install Docker
  3. A GitHub repo that already builds on Travis

Postcondition:

View backup-to-insecure-remote-server
##
## backup-to-insecure-remote-server v1.0
## William Entriken / github.com@phor.net
##
## YOU NEED TO KEEP A BACKUP OF .encfs6.xml AND YOUR PASSKEY!!!
##
## TODO
## * Create a restore action
## * Make a quick task to confirm that restoring works
##
@fulldecent
fulldecent / Google Sheets ETL.php
Last active Nov 7, 2019
Load every Google Sheet you have access to into a MySQL database
View Google Sheets ETL.php
Moved to a full project at:
https://github.com/fulldecent/google-sheets-etl
@fulldecent
fulldecent / fen2html.html
Last active Oct 19, 2019
Paste in a Chess FEN position to get a board representation in HTML
View fen2html.html
<!-- COPIED FROM https://phor.net/gadgets/fen2html/ -->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<title>FEN2HTML</title>
<style>
table.chess { border: 1px solid black; margin: 2px; font-size: xx-large}
View merge-sort-sql-results
<?php
#
# Input multiple SELECT statements from different SQL queries
# get back a single stream of rows with records merged if
# they have the same key
#
function genOneTwoThree() {
foreach ([1=>'one',2=>'two',3=>'three'] as $key => $value) {
# echo "...ready to yield: $key => $number\n";
@fulldecent
fulldecent / Google Analytics Experiments
Created Nov 28, 2018
Show all A/B experiments and the winner for your Google Analytics content experiments
View Google Analytics Experiments
<?php
# Composer: "google/apiclient": "^2.0"
const CREDENTIALS_FILE = '/var/www/vhosts/library/Dashboard-6403d6a8a5b6.json';
function googleGetExperiments()
{
return cache(__FUNCTION__, func_get_args(), 3600*6, function() {
$scopes = [ 'https://www.googleapis.com/auth/analytics.readonly' ];
$client = new Google_Client();
@fulldecent
fulldecent / SuSquares.sol
Created Nov 5, 2018
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=true&gist=
View SuSquares.sol
pragma solidity ^0.4.24;
/******************************************************************************\
*..................................SU SQUARES..................................*
*.....................Cute squares you own and personalize.....................*
*..............................................................................*
* First, I just want to say we are so excited and humbled to get this far and *
* that you're even reading this. So thank you! *
* *
* This file is organized into multiple contracts that separate functionality *
@fulldecent
fulldecent / ALLINONE.sol
Created Oct 23, 2018
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=true&gist=
View ALLINONE.sol
pragma solidity ^0.4.24;
/******************************************************************************\
*..................................SU SQUARES..................................*
*.....................Cute squares you own and personalize.....................*
*..............................................................................*
* First, I just want to say we are so excited and humbled to get this far and *
* that you're even reading this. So thank you! *
* *
* This file is organized into multiple contracts that separate functionality *
View Researching UI Unit Tests in XCode
A view controller cannot segue to another controller without presenting itself.
https://stackoverflow.com/questions/8221787/perform-segue-on-viewdidload
https://stackoverflow.com/questions/10428629/programatically-set-the-initial-view-controller-using-storyboards
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
You can’t perform that action at this time.