Skip to content

Instantly share code, notes, and snippets.

View dammyammy's full-sized avatar

Dammy O dammyammy

View GitHub Profile
Setting up Sendy with Laravel
(there might be bugs, I striped out some parts of my code because what I have is more complicated then that, so, sorry if it's broken!)
--
I would recommand creating a database for Sendy only.
Add Sendy's database into your database.php (1)
Create the Campaign model (2), and specify that you want to use Sendy's database (Campaigns are the only thing we really need to create, other things like creating lists can be done through Sendy interface, and there is a PHP library to add subscribers)
Now, it's time to install Sendy, usually somewhere like yourapp.com/sendy or yourapp.com/newsletter
@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
{
/**
@dammyammy
dammyammy / web.php
Created May 5, 2017 15:41
Load Seperated Routes from a folder.
// Load all separated route files within a specific folder
function loadPartialRoutesFromFolder($directory)
{
foreach (File::files(base_path('/routes/' . $directory)) as $file) {
require_once $file;
}
}
loadPartialRoutesFromFolder('web');
@dammyammy
dammyammy / DB.php
Created April 8, 2017 23:07
DB Class that Wraps around PDO
<?php
namespace Uno\Database;
class DB extends DBInteractor
{
/****************************************
* SELECT QUERIES
*****************************************/
public function getAllData($tableName)
<?php
namespace App\Services;
use App\Data\Core\DB;
class UserTracker
{
public function track()
@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 / _mixins.scss
Created March 19, 2017 01:53
Useful Mixins
/*--------------------------------
Media Queries
used for outputting content either between media query tags
example: basic usage
.element {
width: 50%;
@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 / Alert.js
Created February 25, 2017 17:07
A simple ES6 class Wrapping sweetAlert2
import swal from 'sweetalert2';
class Alert {
static success(title = 'Success!', body = 'Action Completed Successfully!', timer = 2500, confirm = false) {
return swal({
title,
timer,
html: body + '<div class="m-b-50"></div>',
type: 'success',
@dammyammy
dammyammy / ColorGenerator.js
Created February 25, 2017 17:06
A simple color generator ES6 Class
class ColorGenerator {
grab(number) {
var colors = [];
for(var i = 0; i < number; i++){
colors.push(this.random);
}
return colors;
}