Skip to content

Instantly share code, notes, and snippets.

View kgust's full-sized avatar

Kevin Gustavson kgust

  • Vanderbilt University Medical Center
  • Nashville, Tennessee USA
View GitHub Profile
@kgust
kgust / benchmark.php
Created August 15, 2018 02:12
I wanted to benchmark functional PHP vs loops...
<?php
/*
PHP Benchmark
Downloaded from: http://onlinephpfunctions.com
*/
class benchmark
{
@kgust
kgust / build.xml
Created August 15, 2018 02:04
Phing Build Script (replace with bash script)
<?xml version="1.0" encoding="UTF-8"?>
<project name="DISCOVR-e" default="full-build">
<property name="basedir" value="."/>
<!-- Use this when the tools are managed by Composer in ${basedir}/vendor/bin -->
<property name="pdepend" value="${basedir}/bin/pdepend"/>
<property name="phpcpd" value="${basedir}/bin/phpcpd"/>
<property name="phpcs" value="${basedir}/bin/phpcs"/>
<property name="phpdox" value="${basedir}/bin/phpdox"/>
<property name="phploc" value="${basedir}/bin/phploc"/>
<property name="phpmd" value="${basedir}/bin/phpmd"/>
@kgust
kgust / cs_fixer.php
Last active June 17, 2020 12:56
Configurations for php-cs-fixer (we are using phpcs and phpcbf instead)
<?php
require('./vendor/autoload.php');
$finder = PhpCsFixer\Finder::create()
->notPath('vendor')
->in(__DIR__)
->name('*.php')
->ignoreDotFiles(true)
->ignoreVcs(true)
@kgust
kgust / Docker Tips.md
Last active June 18, 2018 18:08
Docker Tips

Categories

Build

docker-compose build .
docker-compose up --detach

Spring Cleaning

@kgust
kgust / LICENSE
Last active January 23, 2018 15:11
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
@kgust
kgust / Roku Secret Menus.md
Last active January 20, 2024 15:35
Roku Secret Menus

Here is a list of currently-working secret menus, though new ones are discovered often:

  • Home x 5 + FF x 3 + RW x 2: Secret screen one (factory reset, USB test, cycle channel store, update server/software, enable debug)
  • Home x 5 + U + R + D + L + U: Secret screen two (cycle screenshot, cycle ad-banner, remote auto-pair, log theme info)
  • Home x 5 + U + D + U + D + U: Wi-Fi secret screen
  • Home x 5 + FF + PP + RW + PP + FF: Platform secret screen
  • Home x 5 + FF + D + RW + D + FF: Antenna secret screen
  • Home x 5 + RW x 3 + FF x 2: Bitrate override
  • Home x 3 + U x 2 + R + L + R + L + R: Developer settings
  • Home x 3 + U x 2 + L + R + L + R + L: Channel info
/* See also https://github.com/sebastianbergmann/php-jenkins-template/issues/127 */
pipeline {
agent any
stages {
stage('Prepare') {
steps {
sh 'composer install'
sh 'rm -rf build/api'
sh 'rm -rf build/coverage'
@kgust
kgust / template_example.html
Last active December 20, 2017 14:41
We should be using the <template> tag instead of <script type="text/x-template">.
<!doctype html>
<!-- Most of this information comes from:
https://www.html5rocks.com/en/tutorials/webcomponents/template/
Apple's propsal adds variables:
https://github.com/w3c/webcomponents/blob/gh-pages/proposals/Template-Instantiation.md
-->
<html>
<head>
<style>
.bordered { border: 1px solid #ddd; border-radius: 4px; }
@kgust
kgust / ADB Over Wi-Fi.md
Created October 22, 2017 03:22
It's possible to run `abd` over wi-fi, but it requires a cable to enable it.

Rooting is not required. With USB cable connected, port 5555 opened across all involved firewalls and debug mode enabled

adb tcpip 5555

then look into wireless properties of your device and the network you use, to see which IP address have been granted to device (or configure your DHCP always to use the same for the device mac address). Then

adb connect 192.168.1.133

(were 192.168.1.133 is a sample IP address).

NOTE: This will only work on Raspian April 2017 or newer
**Before change:**
vcgencmd otp_dump | grep 17
`17:1020000a`
/boot/config.txt (add to bottom):
program_usb_boot_mode=1
**After change:**