Skip to content

Instantly share code, notes, and snippets.

View ldiebold's full-sized avatar

Luke Diebold ldiebold

View GitHub Profile
<?php
...
public function it_can_store_a_zipped_game_file()
{
Storage::fake('games');
$slug = "my-game";
$gameFile = UploadedFile::fake()->create('foo.zip', '800');
<?php
...
public function it_can_store_a_zipped_game_file()
{
// Storage::fake('games');
$slug = "my-game";
$gameFile = UploadedFile::fake()->create('foo.zip', '800');
^+!c::
if WinExist("ahk_exe chrome.exe")
WinActivate, ahk_exe chrome.exe
else
Run, chrome.exe
return
@ldiebold
ldiebold / check-environment.php
Last active April 15, 2018 23:12
Check Laravel Environment
<?php
if (App::environment('local')) {
// The environment is local
}
if (App::environment(['local', 'staging'])) {
// The environment is either local OR staging...
}
@ldiebold
ldiebold / example-quiz-data.json
Last active April 17, 2018 23:41
An example of json data needed for my quiz
{
"heading": "example heading",
"questions": [
{
"question": "what is 1 + 2?",
"choices": [
{
"text": "1",
"type": "text",
"media": {
@ldiebold
ldiebold / graphql-basic-query.js
Created August 17, 2018 03:42
basic graphql query
// query
{
hero {
name
}
}
// result
{
"data": {
@ldiebold
ldiebold / laravel-request-flexible.php
Last active June 5, 2019 10:07
Laravel requests inflexible
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ProjectBillRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
@ldiebold
ldiebold / flexible-request.php
Created June 5, 2019 10:11
Laravel flexible request
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ProjectBillRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
@ldiebold
ldiebold / Comment.js
Created October 2, 2019 05:56
Files for the vuetiful life, vuex-orm series (video 18). 1. Create insertUsers.js in your "src" directory 2. update User.js, Post.js and Comment.js
import { Model } from '@vuex-orm/core'
import User from './User'
export default class Comment extends Model {
static entity = 'comments'
static fields() {
return {
id: this.increment(),
body: this.attr(null),
var result = ''; var elements = document.getElementsByClassName('_2pio'); for(var i = 0; i < elements.length; i++) { result += (elements[i].innerHTML + '\n') } console.log(result)