Skip to content

Instantly share code, notes, and snippets.

View marktopper's full-sized avatar
🚀
Making rocket science

Mark Topper marktopper

🚀
Making rocket science
View GitHub Profile
@marktopper
marktopper / PageController.php
Last active December 24, 2020 20:55
[Voyager] Routes for Pages BREAD
<?php
class PageController extends \App\Http\Controllers\Controller
{
public function show()
{
$slug = request()->segment(1);
$page = \TCG\Voyager\Models\Page::where('slug', $slug)
->firstOrFail();
@marktopper
marktopper / gist:2b7f42bf401dbbcfab206ce89bb77d7e
Created December 3, 2016 13:10 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@marktopper
marktopper / console
Created November 10, 2016 16:33
Valet Install Log
Marks-MacBook-Pro.local ~/Sites $ valet install
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core, homebrew/php).
==> New Formulae
gmic
libosmium
luaver
mfterm
treefrog
@marktopper
marktopper / ContainerExample.md
Last active October 6, 2016 13:28
Fistlab PHP Database Repositories

You can use the Container object as repository handler.

This requires the Container component.

use Fist\Database\Database;
use Fist\Container\Container;
use Fist\Repository\ContainerRepository;

$container = new Container();
@marktopper
marktopper / console.js
Last active September 22, 2016 11:10
[OS.js] Get missing language keys for all languages
console.log(Object.keys(OSjs.Locales).map(function(l) {
return 'Locale `' + l + '` misses:\n' + Object.keys(OSjs.Locales.en_EN).filter(function(v) {
return typeof OSjs.Locales[l][v] === 'undefined';
}).map(function(i) {
return '- ' + i;
}).join('\n');
}).join('\n\n'));
@marktopper
marktopper / OsjsValetDriver.php
Created September 20, 2016 05:43
Valet Driver for OS.js (http://os.js.org)
<?php
class OsjsValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@marktopper
marktopper / deploy.sh
Last active August 29, 2015 14:25
Smarter deployment script for Forge
#!/bin/bash
set -x
domain=$(readlink -f .)
domain=${domain##*/}
timestamp=$(date +%s)
if ! [ -s "current" ]; then
mkdir ../$domain-temp
@marktopper
marktopper / install.md
Last active March 24, 2023 14:49
Install Kong + Cassandra + Java [Ubuntu 14.04]

Installing Java

We need Java in order to have Cassandra running since Cassandra 2.0 and later require Java 7 or later. And we need Cassandra in order to run Kong.

So lets start installing Java 8 (the newest one)

First we add a repository to our build in order to manage the Java 8 package, since that is not normally supported by Ubuntu.

sudo add-apt-repository ppa:webupd8team/java
@marktopper
marktopper / gist:b9c45b1b7c1f7e03030e
Created July 13, 2015 13:36
Install Kong with Java7 + Cassandra
### Installing Java7
# Using Oracle Java 7 is not formally supported by Ubuntu.
# There's plenty solutions for installing it, listed on https://help.ubuntu.com/community/Java .
#
# The simplest one listed is this one:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
# It'll keep your java 7 installation up to date.
# Manually secure port 6379
sudo iptables -A INPUT -p tcp --dport 6379 -s xxx.xxx.xxx.xxx -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 6379 -j DROP
sudo iptables -L
# Save current firewall config
# sudo iptables-save > /etc/iptables.conf
# Above removed - Mark
sudo bash -c "iptables-save > /etc/iptables.conf"