Skip to content

Instantly share code, notes, and snippets.

View ssx's full-sized avatar

Scott Robinson ssx

View GitHub Profile
<?php
namespace App\Nova\Actions;
use App\Models\Order;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\LaravelNovaExcel\Actions\DownloadExcel;
use PhpOffice\PhpSpreadsheet\Shared\Date;
<?php
function main(array $args) : array
{
$name = $args['name'] ?? 'stranger';
$greeting = 'Hello '.$name.'!';
return [
'statusCode' => 201,
'headers' => [
'X-Header-Test' => 'Something shiny',
<?php
function parse(array $args) : array
{
try {
// You could do something with these like calculating the time
// it look to run the job.
$started_at = $args["started_at"];
$completed_at = $args["completed_at"];
// If the job passed, we'll send it to the #ops channel, however
@ssx
ssx / .pre-commit-config.yaml
Created September 7, 2017 17:08
PHP Pre-Commit Example
- repo: https://github.com/digitalpulp/pre-commit-php.git
sha: 1.3.0
hooks:
- id: php-lint
- id: php-unit
- id: php-cbf
files: \.(php)$
args: [--standard=PSR2 --ignore=**/*.blade.php -p]
- id: php-cs
files: \.(php)$
- repo: git@github.com:hootsuite/pre-commit-php.git
sha: 1.2.0
hooks:
- id: php-lint
- id: php-unit
- repo: git://github.com/pre-commit/pre-commit-hooks.git
sha: 5bf6c09bfa1297d3692cadd621ef95f1284e33c0
hooks:
- id: trailing-whitespace
- id: detect-private-key

Keybase proof

I hereby claim:

  • I am ssx on github.
  • I am ssx (https://keybase.io/ssx) on keybase.
  • I have a public key ASD3dyzssp8apFrv6F4-HPwhGhmA6-kuOD7qPOoFZVgAygo

To claim this, I am signing this object:

@ssx
ssx / .gitlab-ci.yml
Created April 15, 2017 07:54
.gitlab-ci.yml for Appcelerator CI testing
image: hellossx/appcelerator-ci
variables:
JAVA_HOME: "/usr/lib/jvm/java-8-oracle/"
ANDROID_HOME: "/usr/local/android/android-sdk-linux"
cache:
key: "costings_app"
untracked: true
stages:
- test
npm_tasks:
@ssx
ssx / test.js
Created April 12, 2017 08:21
test.js
exports.sendViaBluetooth = function(file, title) {
var intent = Ti.Android.createIntent({
action: Ti.Android.ACTION_SEND
});
// File contains a tifileobject.nativePath
intent.putExtraUri(Ti.Android.EXTRA_STREAM, file);
var share = Ti.Android.createIntentChooser(intent, title);
@ssx
ssx / uploads.yml
Created February 24, 2017 14:14 — forked from louim/uploads.yml
Drop-in playbook for Trellis to push and pull uploads from the server to your local machine.
---
- name: Sync uploads between environments
hosts: web
remote_user: "{{ web_user }}"
vars:
project: "{{ wordpress_sites[site] }}"
project_root: "{{ www_root }}/{{ site }}"
tasks:
image: mnapoli/php7-cli
stages:
- test
- deploy
composer_tasks:
stage: test
script:
- composer self-update