Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View sbuzonas's full-sized avatar

Steve Buzonas sbuzonas

View GitHub Profile
@sbuzonas
sbuzonas / nginx-cors.conf
Created September 8, 2015 15:36
Nginx CORS maps
map $http_origin $allow_origin {
default "";
"~^https?://(?:[^/]*\.)?(stevebuzonas\.(?:com|local))(?::[0-9]+)?$" "$http_origin";
}
map $request_method $cors_method {
default "allowed";
"OPTIONS" "preflight";
}
# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
@sbuzonas
sbuzonas / deploy
Last active January 17, 2016 06:22
OpenShift deploy hook to install composer capable of running against php 5.4 with the zend6.1 cart
#!/usr/bin/env bash
GIT_DIR_SAVE=$GIT_DIR ; unset GIT_DIR
GIT_WORK_TREE_SAVE=$GIT_WORK_TREE ; unset GIT_WORK_TREE
if [ ! -f "${OPENSHIFT_DATA_DIR}composer/bin/composer" ]; then
export COMPOSER_HOME="${OPENSHIFT_DATA_DIR}.composer"
echo $COMPOSER_HOME > ${OPENSHIFT_HOMEDIR}.env/user_vars/COMPOSER_HOME
echo "Installing composer"
curl -s https://getcomposer.org/installer | env - PATH="/usr/bin:$PATH" php -- --install-dir=$OPENSHIFT_DATA_DIR >/dev/null
@sbuzonas
sbuzonas / SassMeister-input-HTML.html
Created January 28, 2014 23:04
Generated by SassMeister.com.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CSS Zen Garden: The Beauty of CSS Design</title>
<link rel="stylesheet" media="screen" href="/214/214.css?v=8may2013">
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.csszengarden.com/zengarden.xml">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@sbuzonas
sbuzonas / composer.json
Last active December 18, 2015 16:09
Example to provide alternatives in composer
{
"name": "slbmeh/sample-package",
"repositories": [
{
"type": "package",
"package": {
"name": "alternatives/zend-templating",
"version": "1.0.0",
"type": "metapackage",
"require": {
$params = array(
'oauth_callback' => $this->strategy['oauth_callback'],
'scope' => !isset($this->strategy['scope']) ?: $this->stragegy['scope'],
);
@sbuzonas
sbuzonas / option1.php
Created June 3, 2012 04:42
##php: mikeiee
<?php
$letter_url = "http://www.example.com/letter.php?";
?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
@sbuzonas
sbuzonas / gist:2860218
Created June 2, 2012 22:25
Spammer Blocker Globals Fix
<?php
/*
Plugin Name: Spammer Blocker
Plugin URI: http://wordpress.org/extend/plugins/spammer-blocker
Description: This plugin prevents users from commenting or viewing your website if a comment of theirs has been marked as spam.
Version: 1.6
Author: Lelkoun
Author URI: http://lelkoun.cz
License: GPL2
*/
@sbuzonas
sbuzonas / gist:2716869
Created May 17, 2012 06:05
Add lang variable to wordpress query var stack
function add_lang_var($existing_query_vars) {
$existing_query_vars[] = 'lang';
return $existing_query_vars;
}
add_filter('query_vars', 'add_lang_var');
@sbuzonas
sbuzonas / gist:57cea59ed3dc5de02e54
Created June 22, 2015 11:12
Test script for github.com/composer/composer/issues/4121
<?php
$url = '';
$headers = array(
'User-Agent: DownloadTest',
'Accept-Encoding: gzip',
'Connection: close',
);