Skip to content

Instantly share code, notes, and snippets.

View drmmr763's full-sized avatar

Chad Windnagle drmmr763

View GitHub Profile
@drmmr763
drmmr763 / user.sql
Created April 1, 2015 15:16
mautic user
INSERT INTO `users` (`id`, `role_id`, `is_published`, `date_added`, `created_by`, `created_by_user`, `date_modified`, `modified_by`, `modified_by_user`, `checked_out`, `checked_out_by`, `checked_out_by_user`, `username`, `password`, `first_name`, `last_name`, `email`, `position`, `timezone`, `locale`, `last_login`, `last_active`, `online_status`, `preferences`)
VALUES
(2, 1, 1, '2015-04-01 15:15:07', 1, 'Nobody', NULL, NULL, NULL, NULL, NULL, NULL, 'madmin', '$2y$13$VkE7UjFetqAM13oT4v/VYOfRCGrJ4hbr0zuwRZo6KVfDnNb16WFwy', 'Administrator', 'Uuser', 'user@local.host', NULL, NULL, NULL, NULL, NULL, 'offline', 'N;');
@drmmr763
drmmr763 / RequestCriteria.php
Created November 12, 2015 16:39
custom request criteria
<?php
namespace App\Criteria;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
use Prettus\Repository\Contracts\RepositoryInterface;
use Prettus\Repository\Contracts\CriteriaInterface;
/**
@drmmr763
drmmr763 / default
Last active June 15, 2018 11:35
mautic-symfony-nginx
server {
listen 80;
root /usr/share/nginx/html;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name _;
location / {
@drmmr763
drmmr763 / Dockerfile
Created May 29, 2018 01:12
Xdebug | PHP
FROM ubuntu:latest
RUN apt-get update
RUN apt-get -y install software-properties-common python-software-properties
RUN apt-get -y --no-install-recommends install \
ca-certificates \
inetutils-ping \
telnet \
curl \
nano \
net-tools \
@drmmr763
drmmr763 / oauth.php
Created April 1, 2013 03:18
working on a simple oauth2 app
<?php
session_start();
// define Joomla's framework path
// get bootstrap
require dirname(dirname(dirname(__FILE__))).'/bootstrap.php';
// Increase error reporting to that any errors are displayed.
// Note, you would not use these settings in production.
@drmmr763
drmmr763 / Dockerfile
Created January 7, 2018 21:58
Php 7.2 dockerfile
ubuntu:latest
RUN apt-get update
RUN apt-get -y install software-properties-common python-software-properties
RUN apt-get -y --no-install-recommends install \
ca-certificates \
inetutils-ping \
telnet \
curl \
nano \
net-tools \
@drmmr763
drmmr763 / doctrine-perf.php
Last active December 6, 2017 16:42
findOne vs DQL
<?php
/**
* Class TempRepository
*/
class TempRepository extends EntityRepository
{
/**
* Find a temp entity using the temps ID
*
* @throws NoResultException|NonUniqueResultException
@drmmr763
drmmr763 / akeeba-jenkins.groovy
Last active October 24, 2017 15:09
run akeeba backup cli from jenkins, catch non fatal warnings
node('ampsnet') {
stage('backup-att') {
dir('/home/akeeba/cli') {
try {
def statusCode = sh returnStatus: true, script: 'php backup.php --profile=1'
} catch(Exception e) {
if (statusCode < 2) {
currentBuild.result = 'SUCCESS'
}
}
@drmmr763
drmmr763 / git-cherry-pick-and-revert.md
Created June 29, 2017 17:54
fix commits when you commit on the wrong branch
git checkout -b 'feature-a'
 - git commit -m 'working on feature a'
 - git commit -m 'working on feature a'
---
 - git commit -m 'working on feature b'
 - git commit -m 'working on feature b'
 - git commit -m 'working on feature b'
---
@drmmr763
drmmr763 / hubspot.php
Created September 9, 2015 21:07
hubspot.api
<?php
$query = array(
'refresh_token' => 'xxx', // $this->keys['refresh_token'],
'client_id' => 'yyy', //$this->keys[$this->getClientIdKey()],
'grant_type' => 'refresh_token',
);
$url = 'https://api.hubapi.com/auth/v1/refresh?' . http_build_query($query);
$ch = curl_init();