Skip to content

Instantly share code, notes, and snippets.

View marcusmoore's full-sized avatar

Marcus Moore marcusmoore

View GitHub Profile

###Jeffrey Way (1) - Bootcamp

Jeffrey went through about 12 subjects one right after the other and gave tips along the way.

  1. Mail Drivers for mail notifications.
1. With Laravel 4.2 it’s easier to use APIs like Mailgun and Mandrill for e-mail notifications. This avoids using SMTP which is really cool.
  1. File Generators for generating schema migrations.
@marcusmoore
marcusmoore / quoter.php
Created October 19, 2014 03:55
Send quotes via Twilio
<?php
/*
* Within a Laravel controller function
*/
# Get Twilio sid, token and number from environment variables
$sid = getenv("twilio_sid");
$token = getenv("twilio_token");
$twilio_number = getenv("twilio_number");
<?php
use League\Flysystem\Filesystem;
use League\Flysystem\Adapter\Dropbox;
use League\Flysystem\Adapter\Local;
$dropbox = new Filesystem(new Dropbox($client, 'dropbox/root/dir'));
$local = new Filesystem(new Local('loca/root/path'));
$dropbox->write('destination.ext', $local->read('relative/path/to/file.ext'));
@marcusmoore
marcusmoore / UploadsBackupCommand.php
Created November 10, 2014 04:36
Backup folder to Dropbox with Flysystem within a Laravel command
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Dropbox\Client;
use League\Flysystem\Filesystem;
use League\Flysystem\Adapter\Dropbox;
use League\Flysystem\Adapter\Local;
@marcusmoore
marcusmoore / upload
Created March 18, 2015 16:31
Laravel 5 Filesystem confusion
/*
* By default, the storage path for local is set to |storage_path() . '/app'| which means
* when you use |Illuminate\Contracts\Filesystem\Factory| contract and do something like
* $storage->disk('local')->get('temp/' . $filename) you are effectively working within
* |storage/app/temp| not |storage/temp| as you might have expected. Because you might
* think to move a file with |$request->file('image)->move(storage_path('temp'), $filename))|
* this will fail because storage_path() returns the storage directory (storage/), not
* |storage/app|
*
* Something like the following works but is VERY ugly.
<!doctype html>
<html>
<head>
<title>White Plum Kitchen Sink - Bootstrap 3 Theme</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript" src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>

Handy helpers for controlling visibility of elements until Vue has compiled.

Use like:

<div v-cloak>
  <h1>
    <span class="v-cloak--inline">Loading...</span> <!-- Only displayed before compiling -->
    <span class="v-cloak--hidden">{{ post.title }}</span> <!-- Hidden until compiling is finished -->
 
@marcusmoore
marcusmoore / index.html
Created June 11, 2015 20:24
Socket.IO chat example
<!doctype html>
<html>
<head>
<title>Socket.IO Chat</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font: 13px Helvetica, Arial; }
form { background: #000; padding: 3px; position: fixed; bottom: 0; width: 100%; }
form input { border: 0; padding: 10px; width: 90%; margin-right: .5%; }
form button { width: 9%; background: rgb(130, 224, 255); border: none; padding: 10px; }

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post