Skip to content

Instantly share code, notes, and snippets.

View dammyammy's full-sized avatar

Dammy O dammyammy

View GitHub Profile
@dammyammy
dammyammy / PjaxMiddleware.php
Created October 24, 2015 00:28 — forked from JeffreyWay/PjaxMiddleware.php
Laravel middleware for working with pjax.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Symfony\Component\DomCrawler\Crawler;
class PjaxMiddleware
@dammyammy
dammyammy / countries.php
Created October 24, 2015 00:33 — forked from JeffreyWay/countries.php
Country Names + Codes
[
"United States" => "us",
"Afghanistan" => "af",
"Albania" => "al",
"Algeria" => "dz",
"American Samoa" => "as",
"Andorra" => "ad",
"Angola" => "ad",
"Anguilla" => "ai",
"Antarctica" => "aq",
@dammyammy
dammyammy / sample_class.php
Created February 1, 2016 00:01 — forked from cjsaylor/sample_class.php
Convenient PHPUnit mocking of Singleton Classes
<?php
class Sample {
public __construct() {
}
public function sayHello($name) {
return Someclass::getInstance()->hello($name);
}
@dammyammy
dammyammy / Dockerfile
Created May 12, 2016 23:41 — forked from yefim/Dockerrun.aws.json
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
# Example Dockerfile
FROM hello-world
@dammyammy
dammyammy / HEY-YOU.md
Created September 1, 2016 03:15 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
router.afterEach((to, from) => {
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Models\NotificationProvider;
use App\Models\RepositoryProvider;
use App\Models\Server\Provider\ServerProvider;
use App\Models\User\User;
use App\Models\User\UserLoginProvider;
@dammyammy
dammyammy / readme.md
Created March 9, 2017 11:14 — forked from jobsamuel/readme.md
Run NodeJS as a Service on Ubuntu 14.04 LTS

Run NodeJS as a Service on Ubuntu 14.04 LTS

With Node you can write very fast JavaScript programs serverside. It's pretty easy to install Node, code your program, and run it. But > how do you make it run nicely in the background like a true server?

  • Go to /etc/init/
  • $ sudo vim yourapp.conf
  • Paste script.conf
  • $ sudo start yourapp
  • And when you wanna kill the process $ sudo stop yourapp
@dammyammy
dammyammy / web.config
Created March 27, 2017 19:42 — forked from DWboutin/web.config
web.config GZIP compression Add the configuration shown below in the in web.config file. This configuration setup enable gzip compression on static and on dynamic content.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/>
<dynamicTypes>
<add mimeType="text/*" enabled="true"/>
<add mimeType="message/*" enabled="true"/>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="*/*" enabled="false"/>
@dammyammy
dammyammy / PostmarkServiceProvider.php
Created July 13, 2017 20:30 — forked from tylerodonnell/PostmarkServiceProvider.php
How to use Postmark SwiftMailer inside Laravel
<?php
namespace App\Providers;
use Postmark\Transport;
use Illuminate\Mail\MailServiceProvider;
class PostmarkServiceProvider extends MailServiceProvider
{
/**