Skip to content

Instantly share code, notes, and snippets.

View ssx's full-sized avatar

Scott Robinson ssx

View GitHub Profile
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
<?php
namespace App\Factories;
abstract class Factory
{
public function instance()
{
return $this;
}
@Ocramius
Ocramius / Caddyfile
Last active May 30, 2018 07:23
Example of Caddy in front of an HTTP server
{$CADDY_WEB_HOST}:443 {
proxy / the-webserver.internal-network:80
tls self_signed
}
{$CADDY_WEB_HOST}:80 {
redir https://{$CADDY_WEB_HOST}{uri}
}
@peterpan666
peterpan666 / LaraconUS_2017_Talks.md
Last active July 26, 2017 08:23
LaraconUS 2017 Talks

Day 1

  • Freek Van der Herten (Custom dashboard)

  • Tom Schlick (Build a multi-tenancy app)

  • Adam Wathan (Never Write Custom Actions on a controller)

  • Maxime Locqueville (Build a search system with Scout + Algolia + VueJS)

@Rajeshr34
Rajeshr34 / wkhtmltopdf.sh
Last active February 18, 2025 00:30
Wkhtmltopdf With Patched QT Setup Ubuntu 16+
cd ~
apt-get install libfontenc1 xfonts-75dpi xfonts-base xfonts-encodings xfonts-utils openssl build-essential libssl-dev libxrender-dev git-core libx11-dev libxext-dev libfontconfig1-dev libfreetype6-dev fontconfig -y
#https://github.com/wkhtmltopdf/wkhtmltopdf/releases
#replace arch
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb
apt --fix-broken install
@hikari-no-yume
hikari-no-yume / example.php
Created March 20, 2017 20:02
function chaining for PHP 7
<?php declare(strict_types=1);
require_once "✨.🐘";
($_)->strlen("foo")->var_dump($_);
@erikhansen
erikhansen / 1_product_queries.sql
Last active May 2, 2025 07:44
Magento 2 - Remove duplicate store view-specific product and category data
/*
* IMPORTANT: The queries below are written for Magento Enterprise. If you're going to run them on Magento Community, you need
* to replace all instances of ".row_id" with ".entity_id". See this for context: http://magento.stackexchange.com/questions/139740/magento-2-schema-changes-for-ee-catalog-staging
*
* When importing products in Magento 2, if you specify store view codes in the store_view_code column, product data will be set at
* both the global scope as well as the specific store view scope. This is not ideal because now you have duplicate
* data at two different scopes that shouldn't actually be duplicated. The scripts below clean up this data by finding
* data set at specific store view scopes and if it's an exact match to the data set at the global store view, then it
* deletes the data set at the specific store view scope.
*
@section-io-gists
section-io-gists / hashByProto.vcl
Created February 16, 2017 04:34
Split Varnish Cache by the request header X-Forwarded-Proto - Useful when the origin is doing GEO IP redirects or changing content according to protocol
sub vcl_hash {
#Vary cache by protocol type to avoid caching things like HTTP->HTTPS redirects and different versions of files
hash_data(req.http.X-Forwarded-Proto);
}