Skip to content

Instantly share code, notes, and snippets.

View danjohnson95's full-sized avatar

Dan danjohnson95

View GitHub Profile

Keybase proof

I hereby claim:

  • I am danjohnson95 on github.
  • I am danjohnson95 (https://keybase.io/danjohnson95) on keybase.
  • I have a public key ASBHLBFALXyBeCgpuq2usiZ0g7F7e51CbPnvWTYdC1q_Ngo

To claim this, I am signing this object:

@danjohnson95
danjohnson95 / commit-msg
Created October 6, 2017 13:39
A git hook for enforcing a commit message standard
#!/bin/bash
#
# The link to the wiki page detailing these standards
url='https://github.com/designmynight/dmn/wiki/Semantic-Commit-Messages'
# The regular expression in which the commit message should match
regex='^(fix|feat|chore|refactor|test|style|docs)(:\s)([\S].{1,60}[\S])'
# What we'll say
error_msg="Aborting commit due to incorrect message format.\nPlease see $url"
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use App\Contracts\ProductDataInterface;
use App\Models\Product;
class ProductServiceProvider extends ServiceProvider
{
/**
* Bind the ProductDataInterface to the implementation
<?php namespace App\Contracts;
interface ProductDataInterface
{
/**
* Sets the title of the product
* @param string $title
* @return $this
*/
public function setTitle($title);
<?php namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use App\Contracts\ProductDataInterface;
class Product extends Model implements ProductDataInterface
{
protected $table = "products";
/**
<?php namespace App\Repos;
use App\Contracts\ProductDataInterface;
class ProductRepository
{
/**
* An instance of the Product model
* @var \App\Contracts\ProductDataInterface
*/
<?php namespace App\Http\Controllers;
use App\Repos\ProductRepository;
class ProductController extends Controller
{
/**
* An instance of the Product Repository
* @var \App\Repos\ProductRepository
*/
@danjohnson95
danjohnson95 / search.js
Created February 15, 2017 16:24
Node search engine
var http = require('http');
module.exports = function(){
var server;
var port = 3050;
startServer = function(){
server = http.createServer(handleRequest);
server.listen(port);