Skip to content

Instantly share code, notes, and snippets.

View carbontwelve's full-sized avatar
🎯
Focusing

Simon Dann carbontwelve

🎯
Focusing
View GitHub Profile
body{
background: #fff3e1;
color: #5a5a5a;
font-size: 20px;
}
body h1 a, body header h2 a {
color: #5a5a5a;
}
@carbontwelve
carbontwelve / RouteListCommand.php
Created November 9, 2018 12:25
Command that overloads the laravel route:list and adds tenant aware capabilities.
<?php
namespace App\Console\Commands;
use Illuminate\Foundation\Console\RouteListCommand as BaseRouteListCommand;
use Illuminate\Routing\RouteCollection;
use Illuminate\Routing\UrlGenerator;
use Symfony\Component\Console\Input\InputOption;
class RouteListCommand extends BaseRouteListCommand
@carbontwelve
carbontwelve / README.md
Last active October 19, 2018 23:40
Installing PHP7.2 on Debian 9 for pixelfed and pleroma

Installing dependencies for Pleroma and Pixelfed

This is an install guide for getting pixelfed and pleroma installed and sharing a dedicated server running Debian 9.

Todo

Notes

@carbontwelve
carbontwelve / BasicWebAuth.php
Created November 3, 2015 16:33
BasicAuth Middleware Laravel/Lumen
<?php namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Response;
class BasicWebAuth
{
/**
* Name of the realm
*
@carbontwelve
carbontwelve / EloquentRepository.php
Last active May 30, 2018 11:20
Repository pattern for woogle
<?php namespace Photogabble\Database;
use Illuminate\Database\Eloquent\Model;
class EloquentRepository
{
/** @var \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Query\Builder */
protected $model;
public function __construct($model = null)
@carbontwelve
carbontwelve / index.html
Last active January 23, 2018 10:55
Scratch Card
<html>
<head>
<style>
.box, .winner{
background: #ccc;
margin: 10px 5px;
width: 30px;
height: 30px;
text-align: center;
float: left;
@carbontwelve
carbontwelve / console.sh
Last active November 17, 2017 22:45
Identify files modified between two versions
# Ask the user for the two hashes from -> to
git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT $FROM $TO
# If $TO is longform use the below to check the user is currently there
git rev-parse HEAD
# Else use the below for shortform hash
git log --pretty=format:'%h' -n 1
# If the current HEAD is not $TO then exit and tell the user to checkout the right version.
@carbontwelve
carbontwelve / index.html
Last active October 24, 2017 19:29 — forked from danielpradilla/index.html
HTML5 skeleton
<!DOCTYPE html>
<html lang="en">
<head>
<title>title</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" type="text/css" href="css/all.css">
@carbontwelve
carbontwelve / slack_logs.rb
Created August 22, 2017 15:28 — forked from 0x263b/slack_logs.rb
Obtain channel logs from Slack's API
#!/usr/bin/env ruby
# encoding: utf-8
# Uses the following Slack API methods:
# user.list → https://api.slack.com/methods/users.list
# channels.history → https://api.slack.com/methods/channels.history
require "open-uri"
require "json"
# Obtain a token
@carbontwelve
carbontwelve / routes.php
Last active June 13, 2017 15:02
Twitter Auth with Slim3
<?php
use Abraham\TwitterOAuth\TwitterOAuth;
/* This is the basics required for authentication via twitter. The twitter/callback needs to match the returned user id
* with one in storage and set the account for the current session.
*
*
*/
define('CONSUMER_KEY', '');