Skip to content

Instantly share code, notes, and snippets.

View CLOUGH's full-sized avatar
🏠
Working from home

Warren Clough CLOUGH

🏠
Working from home
View GitHub Profile
@CLOUGH
CLOUGH / regex.txt
Created April 5, 2019 22:12
Convert GraphQL variables to java variables in vscode
(\w+):\s{0,1}\[{0,1}(\w+)\]{0,1}
private $2 $1;
@CLOUGH
CLOUGH / MakeTransformerCommand.php
Last active September 15, 2016 17:19
A Laravel console command for generating transformer templates based on Laravel's own implementation of their make commands.
<?php
namespace App\Console\Commands;
use Illuminate\Support\Str;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Console\Command;
class MakeTransformerCommand extends Command
{
@CLOUGH
CLOUGH / gist:d744ffb33c13b391f537
Created January 26, 2016 21:03
Excel formula creating a unix timestamp from a date and time cell.
=IFERROR((P2+N2- DATE(1970,1,1))*86400,0)
@CLOUGH
CLOUGH / nestedWatch.js
Last active August 29, 2015 14:27
Allow angular to watch nested object properties in array
$scope.chartBuilder = {
charts: [{
name: 'Gauge Chart',
type: 'gauge',
description: '',
title: '',
series: [{
resultQueryType: "",
resultQueryID: 0,
resultQueryFactID: 0,
@CLOUGH
CLOUGH / ckeditor
Last active August 29, 2015 14:21
Textarea and ckeditor
{!! Form::textarea('content',null, ['id'=>'content']) !!}
<script>CKEDITOR.replace( 'content',{height: 500});</script>
@CLOUGH
CLOUGH / isSquare.js
Created April 17, 2015 15:17
Check to see if a list of coords form a square
var isSquare = function(cords){
console.log(cords);
for(var i=0;i<cords.length-1;i++){
var currentVector = Math.pow(cords[i].x-cords[i+1].x,2) + Math.pow(cords[i].y-cords[i+1].y,2);
if(i==0){
previousVector = currentVector;
console.log(currentVector, previousVector);
}
else{
console.log(currentVector, previousVector);