Skip to content

Instantly share code, notes, and snippets.

View shawnsandy's full-sized avatar

Shawn Sandy shawnsandy

View GitHub Profile
@shawnsandy
shawnsandy / README.md
Created February 21, 2017 18:05
Test

Test

@shawnsandy
shawnsandy / README.md
Created February 21, 2017 17:22
Test

Test

@shawnsandy
shawnsandy / README.md
Created February 21, 2017 17:15
New Collection

New Collection

@shawnsandy
shawnsandy / save-gist.php
Created February 21, 2017 05:02
Gist Content Methods
<?php
/**
* @param array $data
* @return bool
*/
function create($data = [])
{
if (empty($data)) return FALSE;
@shawnsandy
shawnsandy / getfile.php
Last active February 18, 2017 02:06
SSH commands in Laravel
<?php
use Collective\Remote\RemoteFacade as SSH;
class SampleSSH {
public function getFile()
{
@shawnsandy
shawnsandy / package-service-provider.php
Last active February 11, 2017 21:29
Sample Package Service Provider
<?php
/**
* Created by PhpStorm.
* User: Shawn
* Date: 2/11/2017
* Time: 12:37 PM
*/
namespace ShawnSandy\GitContent\Stories;
@shawnsandy
shawnsandy / sample1.js
Last active February 11, 2017 19:58
Check form for fields/elements with required class.
$("form").each(function() {
var inputs = $(this).find(".required");
$(inputs).each(function(){
var val = $(this).val();
console.log(val);
});
@shawnsandy
shawnsandy / git-clone-clean-restart.md
Last active February 10, 2017 17:08
Git commands

Clone and start a fresh repo

Remove git and init

rm -rf .git && git init 
@shawnsandy
shawnsandy / confirm-delete-button.js
Last active March 14, 2017 20:35
Jquery Toggle Elements
$(".delete-success").click(function (e) {
var btn = $(this);
if ($(this).text() == "Delete") {
e.preventDefault();
$(this).html("<i class=\"fa fa-times\"></i>Confirm");
setTimeout(function() {
console.log(btn);
$(btn).text("Delete")
@shawnsandy
shawnsandy / refactor.php
Last active February 8, 2017 22:21
Refactor gist create method (before)
<?php
/**
* @param array $data
* @return bool
*/
function create($data = [])
{