Skip to content

Instantly share code, notes, and snippets.

View dennyweiss's full-sized avatar

Denny Weiß dennyweiss

View GitHub Profile
@dennyweiss
dennyweiss / SassMeister-input-HTML.html
Last active August 29, 2015 14:09
css background-size - <img> js based demo
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="container">
<img
class="bg-img"
src="http://placekitten.com/g/200/300"
alt="kitten"
>
<img class="bg-img" src="http://placekitten.com/g/200/300">
<img class="bg-img" src="http://placekitten.com/g/200/300">
@dennyweiss
dennyweiss / SassMeister-input-HTML.html
Created November 13, 2014 10:28
Generated by SassMeister.com.
<h1>elbworx website style guide</h1>
<p>A quick-and-dirty frontend styleguide, designed to be copied and pasted into your CMS.</p>
<hr/>
<h1 id="headings">Headings</h1>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
#!/bin/bash
# Script for placing sudoers.d files with syntax-checking
# Making a temporary file to contain the sudoers-changes to be pre-checked
TMP=$(mktemp -t vagrant_sudoers)
cat /etc/sudoers > $TMP
cat >> $TMP <<EOF
# Allow passwordless startup of Vagrant when using NFS.
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/su root -c echo '*' >> /etc/exports
#!/bin/bash
# install homebrew's official php tap
brew tap josegonzalez/homebrew-php
# install homebrew-dupes (required to install zlib, php54's dependency)
brew tap homebrew/dupes
# install nginx + mysql + php 5.4 + php-fpm + apc + xdebug
brew install nginx mysql
#!/bin/bash
while read LINE; do
curl -o /dev/null --silent --progress-bar --head --write-out '%{http_code} %{time_starttransfer} %{url_effective}\n' "$LINE" >> urls_result.txt
done < urls.txt
<?php
defined( 'ABSPATH' ) OR exit;
/**
* Plugin Name: (WCM) PHPMailer Exceptions & SMTP
* Description: WordPress by default returns <code>FALSE</code> instead of an <code>Exception</code>. This plugin fixes that.
*/
add_action( 'phpmailer_init', 'WCMphpmailerException' );
function WCMphpmailerException( $phpmailer )
{
@dennyweiss
dennyweiss / pre-commit
Created February 1, 2016 14:21 — forked from martinbean/pre-commit
Pre-commit hook to detect if any files contain dd()
#!/usr/bin/php
<?php
$files = shell_exec('git diff-index --name-only --cached --diff-filter=ACMR HEAD | grep "\.php$"');
$files = explode("\n", trim($files));
$exitCode = 0;
foreach ($files as $file) {
if (empty($file)) {
@dennyweiss
dennyweiss / gist:bdc30baa81ebb7066f5391b776751652
Created April 27, 2016 21:10 — forked from fennb/gist:1283573
nginx microcaching config example
# Set cache dir
proxy_cache_path /var/cache/nginx levels=1:2
keys_zone=microcache:5m max_size=1000m;
# Virtualhost/server configuration
server {
listen 80;
server_name yourhost.domain.com;
# Define cached location (may not be whole site)