Skip to content

Instantly share code, notes, and snippets.

@jpgreth
jpgreth / web-servers.md
Created February 6, 2017 16:34 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@jpgreth
jpgreth / gogs
Created February 2, 2017 09:12 — forked from infostreams/gogs
Debian startup (init.d) script for gogs.io
#! /bin/sh
### BEGIN INIT INFO
# Provides: gogs
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Git repository manager Gogs
# Description: Starts and stops the self-hosted git repository manager Gogs
### END INIT INFO
@jpgreth
jpgreth / README-Template.md
Created September 28, 2016 09:54 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisities

Requirements for deployment

  • ssh (generate key and put on server)
  • rsync must be available on both machines (deployment host and target host)
  • PHP cli binary must be available on both machines (deployment host and target host)
  • composer must be available on deployment host

Needed info for each target system:

  • deploy directory
@jpgreth
jpgreth / ExistsValidator.php
Created July 7, 2016 13:31 — forked from bwaidelich/ExistsValidator.php
TYPO3 Flow – Unique & Exists Validators
<?php
namespace My\Package\Validation;
use TYPO3\Flow\Persistence\RepositoryInterface;
class ExistsValidator extends \TYPO3\Flow\Validation\Validator\AbstractValidator {
/**
* @var array
*/
@jpgreth
jpgreth / ActionIfGrantedViewHelper.php
Created June 16, 2016 15:26 — forked from bwaidelich/ActionIfGrantedViewHelper.php
A simple Neos Flow ViewHelper that only renders an action link if the target action is granted by the currently authenticated account. Otherwise it will only render the link text
<?php
namespace Your\Package\ViewHelpers\Link;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Aop\JoinPoint;
use TYPO3\Flow\Mvc\ActionRequest;
use TYPO3\Flow\Security\Authorization\Privilege\Method\MethodPrivilegeInterface;
use TYPO3\Flow\Security\Authorization\Privilege\Method\MethodPrivilegeSubject;
use TYPO3\Flow\Security\Authorization\PrivilegeManagerInterface;
use TYPO3\Fluid\ViewHelpers\Link\ActionViewHelper;
@jpgreth
jpgreth / index.html
Created January 28, 2016 13:23 — forked from anonymous/index.html
Bootstrap 3 responsive columns of same height Bootstrap 3 responsive columns of same height // source http://jsbin.com/valajojuha
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Bootstrap 3 responsive columns of same height</title>
<meta name="description" content="Bootstrap 3 responsive columns of same height">
<!-- include bootstrap -->
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<style id="jsbin-css">
/* USAGE
@jpgreth
jpgreth / install_mysql.sh
Created October 27, 2015 16:47 — forked from rrosiek/install_mysql.sh
Vagrant provision script for php, Apache, MySQL, phpMyAdmin, Laravel, and javascript helpers. Outputs nearly everything to /dev/null since "quiet" on most commands is still noisy.
#! /usr/bin/env bash
# Variables
APPENV=local
DBHOST=localhost
DBNAME=dbname
DBUSER=dbuser
DBPASSWD=test123
echo -e "\n--- Mkay, installing now... ---\n"
@jpgreth
jpgreth / bootstrap3_print.css
Created October 7, 2015 15:24 — forked from donnierayjones/LICENSE
Render Bootstrap as "small" layout when printing
@media print {
.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
float: left;
}
.col-sm-12 {
width: 100%;
}
.col-sm-11 {
width: 91.66666667%;
}
<?php
namespace NameOfVendor\NameOfExtension\ViewHelpers;
/***************************************************************
* Copyright notice
*
* (c) 2010 Franz Koch <typo3@elements-net.de>, Koch & Koch GbR
*
* All rights reserved