Skip to content

Instantly share code, notes, and snippets.

View dammyammy's full-sized avatar

Dammy O dammyammy

View GitHub Profile
@dammyammy
dammyammy / Graph.vue
Created February 25, 2017 17:04
My Graph Vue Component Dependent on ChartJs, Axios, and My Color Generator
<template>
<canvas ref="canvas"></canvas>
</template>
<script>
import Chart from 'chart.js';
import ColorGenerator from '../core/ColorGenerator';
export default Vue.extend({
<?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;
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;
@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.
@dammyammy
dammyammy / TextFileReader.java
Last active August 21, 2016 14:23
An Extremely Simple Text File Reader Written in Java. (As a beginner's Tutorial)
/* import all packages within the io namespace. (Mostly handles input/output operations)
* import all packages within the util namespace. (Include all Utilities)
*/
import java.io.*;
import java.util.*;
/*
* The general format of a class is the [accessModifier] class [className] {}
*
@dammyammy
dammyammy / Running Tests on your Laravel Elixir Projects With Karma.md
Last active August 10, 2016 13:06
Running Tests on your Laravel Elixir Projects With Karma, Webpack & Jasmine

Running Tests on your Laravel Elixir Projects With Karma

You may want to run tests on your Javascript Files Within your Laravel Elixir Project, and wondering where to begin. Look no further, with Jasmine, Karma & Webpack, you'll be up and running in no time.

In this Tutorial I would be Using Vue, but feel free to adapt this to whatever you like.

Note This was tested with Laravel 5.3 (dev-develop branch), should work if you have your 5.2 or lower project configured to use webpack already. Laravel 5.3 comes with webpack out of the box.

Step 1: Installing Needed Dependencies via NPM

@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 / 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 / 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 / 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