Skip to content

Instantly share code, notes, and snippets.

View jeffwray's full-sized avatar

Jeffrey Wray jeffwray

View GitHub Profile
@jeffwray
jeffwray / 2019_11_03_081136_alter_all_table_id.php
Created July 28, 2023 21:57 — forked from afiqiqmal/2019_11_03_081136_alter_all_table_id.php
Migrate bigIncrements to increments with foreign key attached
<?php
/**
* Created by PhpStorm.
* User: hafiq
* Date: 03/11/2019
* Time: 11:36 PM
*/
use Illuminate\Support\Facades\Schema;
@jeffwray
jeffwray / README.md
Created September 17, 2021 02:25 — forked from oodavid/README.md
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

@jeffwray
jeffwray / UuidModel.php
Created May 26, 2017 14:33 — forked from danb-humaan/UuidModel.php
Trait for implementing UUIDs in Laravel models
<?php
namespace App\Traits;
use Rhumsaa\Uuid\Uuid;
use Illuminate\Database\Eloquent\ModelNotFoundException;
/**
* Trait UuidModel
* @package App\Traits
@jeffwray
jeffwray / DB.sql
Last active August 29, 2015 14:13 — forked from msurguy/DB.sql
CREATE TABLE `makers` (
`id` int(10) unsigned NOT NULL,
`name` varchar(255) NOT NULL,
`description` varchar(255) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
function send_remote_syslog($message, $component = "web", $program = "next_big_thing") {
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
foreach(explode("\n", $message) as $line) {
$syslog_message = "<22>" . date('M d H:i:s ') . $program . ' ' . $component . ': ' . $line;
socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, 'logs.papertrailapp.com', MY_PORT);
}
socket_close($sock);
}
send_remote_syslog("Test");
@jeffwray
jeffwray / API.md
Created October 2, 2013 13:38 — forked from iros/API.md

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method: