Skip to content

Instantly share code, notes, and snippets.

View kevinkhill's full-sized avatar

Kevin Hill kevinkhill

View GitHub Profile
@kevinkhill
kevinkhill / next.js
Last active June 26, 2021 14:36
Clicking the `>` in TestOut
// Paste this line into your console (it might give you a warning) and in 12 seconds, it will "click" the `>`
setTimeout(()=>(document.getElementById("ProductViewer-NavNextBtn")).dispatchEvent(new Event('click',{bubbles:true,cancellable:true})), 12*1000);
@kevinkhill
kevinkhill / alert.js
Created June 23, 2021 03:16
Remote Alert
StrokesPlus.UI.Alert("It Works!", "Remote Alert");
@kevinkhill
kevinkhill / canvas-colorizer.userscript.js
Last active August 29, 2021 14:36
Canvas Sidebar Colorizer UserScript
// ==UserScript==
// @name Canvas Sidebar Colorizer
// @namespace http://kevinhill.codes/
// @version 0.2
// @description Change the sidebar color
// @author You
// @match https://sierra.instructure.com/*
// @grant none
// ==/UserScript==
@kevinkhill
kevinkhill / Issue132.php
Created April 25, 2016 13:33
Lavacharts Issue Solution
<?php
$data = $lava->DataTable();
$data->addStringColumn('Practice');
$data->addNumberColumn('Rooms');
$data->addNumberColumn('Capacity');
$data->addRow([ 'Yours', 1.45, 0.37 ]);
$data->addRow([ 'Benchmark', 1.6, 0.39 ]);
@kevinkhill
kevinkhill / Issue131.php
Last active April 25, 2016 13:33
Lavacharts Issue Solution
<?php
$employeeCount = rand(2,6);
$salesTable = $lava->DataTable();
$salesTable->addDateColumn('Date');
for ($a=0; $a <= $employeeCount; $a++) {
$salesTable->addNumberColumn('Employee'.$a);
}
@kevinkhill
kevinkhill / lava.js-3.1-tests.php
Created February 17, 2016 20:55
Testing 3.1 branch with lava.js overhaul
<?php
error_reporting(-1);
require('Carbon-1.18.0\src\Carbon\Carbon.php');
require('../lavacharts/src/Lavacharts.php');
use \Khill\Lavacharts\Lavacharts;
$lava = new Lavacharts;
@kevinkhill
kevinkhill / DataFactory.php
Last active January 7, 2019 18:55
New ways for creating DataTables for Lavacharts
<?php
use \Khill\Lavacharts\DataTables\DataFactory;
// Underneath the DataFactory, this is just a shortcut to calling
// addColumns then addRows
$data = DataFactory::DataTable([
['string', 'name'],
['number', 'donuts']
],[
@kevinkhill
kevinkhill / arrayToDataTable.php
Last active February 5, 2016 14:37
Mimicking Google's arrayToDataTable Method
<?php
use \Khill\Lavacharts\DataTables\DataFactory;
// Taken straight from Google's example for BubbleCharts
// The method will assign colmun types based on the data from
// the rows (currently only strings and numbers)
$data = DataFactory::arrayToDataTable([
['ID', 'Life Expectancy', 'Fertility Rate', 'Region', 'Population'],
['CAN', 80.66, 1.67, 'North America', 33739900],
<html>
<head>
<title>Lavacharts Dashboard</title>
</head>
<body>
<div id="my-dash">
<div id="chart">
</div>
<div id="control">
</div>
@kevinkhill
kevinkhill / dashboard-example.php
Last active January 17, 2016 22:47
Dashboard Example
<?php
$datatable = $lava->DataTable();
$datatable->addStringColumn('Name');
$datatable->addNumberColumn('Donuts Eaten');
$datatable->addRows([
['Michael', 5],
['Elisa', 7],
['Robert', 3],
['John', 2],