Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View carbontwelve's full-sized avatar
🎯
Focusing

Simon Dann carbontwelve

🎯
Focusing
View GitHub Profile
@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 / 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 / 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 / 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 / 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', '');
//
// Based upon http://stackoverflow.com/questions/26580683/caching-image-optimization-tasks-in-gulp
//
var gulp = require('gulp'),
gutil = require('gulp-util'),
chalk = require('chalk'),
yargs = require('yargs'), // https://www.npmjs.com/package/yargs
exec = require('child_process').exec, // https://www.npmjs.com/package/gulp-exec
imagemin = require('gulp-imagemin'), // https://github.com/sindresorhus/gulp-imagemin
@carbontwelve
carbontwelve / gist:392c6e455ecb9d00e7d4cfded78e2a47
Created March 14, 2017 12:31
mounting additional volumes on scaleway
// https://community.online.net/t/automatic-mounting-of-additional-volumes-using-systemd-on-ubuntu/3102
// https://community.online.net/t/how-to-attach-and-detach-additional-volumes-to-an-existing-c1-server-scaleway/1160/13
[Unit]
Description=Mount NDB Volume at boot
After=syslog.target
After=network.target
[Mount]
What=UUID="ab542456-a2b8-4e4f-87d3-2d8936c5ac99"
@carbontwelve
carbontwelve / install.sh
Last active March 14, 2017 12:47
LEMP Stack
// Debian
wget https://packages.sury.org/php/apt.gpg && apt-key add apt.gpg && rm apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
// Ubuntu
// Both
apt-get update && apt-get upgrade
apt-get install zip htop bmon mc nginx php7.1-cli php7.1 php7.1-fpm php7.1-curl php7.1-zip php7.1-gd php7.1-xml php7.1-mysql php7.1-mcrypt php7.1-mbstring php7.1-opcache mariadb-server mariadb-client