Skip to content

Instantly share code, notes, and snippets.

View cburyta's full-sized avatar

Chris Buryta cburyta

  • Buffalo, NY
View GitHub Profile
@cburyta
cburyta / pg-merge-with-deletes.sql
Last active March 25, 2024 15:55
Postgres 15+ merge (with delete) example
create schema if not exists sample;
set search_path = sample;
create table if not exists sample_src
(
pk int primary key,
txt varchar(255)
);
create table if not exists sample_dest
@cburyta
cburyta / doctrine.yaml
Last active January 16, 2018 04:09
Pull database configs into a Symfony app using symfony/flex on Platform.sh
# file: config/packages/doctrine.yaml
parameters:
# Adds a fallback DATABASE_URL if the env var is not set.
# This allows you to run cache:warmup even if your
# environment variables are not available yet.
# You should not need to change this value.
env(DATABASE_URL): ''
doctrine:
/**
* ================== angular-ios9-uiwebview.patch.js v1.1.1 ==================
*
* This patch works around iOS9 UIWebView regression that causes infinite digest
* errors in Angular.
*
* The patch can be applied to Angular 1.2.0 – 1.4.5. Newer versions of Angular
* have the workaround baked in.
*
* To apply this patch load/bundle this file with your application and add a
@cburyta
cburyta / createDemoImages.sh
Created November 12, 2012 16:20
Create numbered demo images
#!/bin/bash
# goal: use imagemagik to create a series of numbered images for
# use with bulk uploads testing. creates images in the
# folder defined in $DEST
#
# usage: ./createDemoImages.sh
# the folder to save them to
DEST='images'
@cburyta
cburyta / gist:3824824
Created October 3, 2012 03:29
Example: Librarian in rake task
namespace 'librarian' do
# see https://github.com/applicationsonline/librarian-chef
desc "install cookbooks using librarian-chef"
task "update" do
# sh "librarian-chef update --verbose"
sh "librarian-chef update"
end
end
@cburyta
cburyta / gist:3813579
Created October 1, 2012 18:34
littlechef error after yum package installs
--2012-10-01 17:17:03-- http://production.cf.rubygems.org/rubygems/rubygems-1.7.2.tgz
Resolving production.cf.rubygems.org... 54.240.170.140, 54.240.170.144, 54.240.170.149, ...
Connecting to production.cf.rubygems.org|54.240.170.140|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 245606 (240K) [binary/octet-stream]
Saving to: “rubygems-1.7.2.tgz”
100%[=============================================================================================================================>] 245,606 --.-K/s in 0.01s
2012-10-01 17:17:03 (22.7 MB/s) - “rubygems-1.7.2.tgz” saved [245606/245606]
<?php // Contact Us page ?>
<?php query_posts( 'pagename=contact-us' ); ?>
<?php get_template_part('page', 'contact') ?>
<?php wp_reset_postdata(); // Reset Post Data ?>
@cburyta
cburyta / gist:2972556
Created June 22, 2012 12:46
PHP Pear Package Provider: channel-discover error
Fri, 22 Jun 2012 12:43:31 +0000] DEBUG: Processing package[php] on urbansitter.dev
[Fri, 22 Jun 2012 12:43:31 +0000] INFO: Processing package[php] action install (php::package line 32)
[Fri, 22 Jun 2012 12:43:31 +0000] DEBUG: package[php] checking yum info for php
[Fri, 22 Jun 2012 12:43:31 +0000] DEBUG: package[php] installed version: 5.3.3-3.el6_2.8 candidate version: 5.3.3-3.el6_2.8
[Fri, 22 Jun 2012 12:43:31 +0000] DEBUG: package[php] is already installed - nothing to do
[Fri, 22 Jun 2012 12:43:31 +0000] DEBUG: Processing package[php-devel] on urbansitter.dev
[Fri, 22 Jun 2012 12:43:31 +0000] INFO: Processing package[php-devel] action install (php::package line 32)
[Fri, 22 Jun 2012 12:43:31 +0000] DEBUG: package[php-devel] checking yum info for php-devel
[Fri, 22 Jun 2012 12:43:31 +0000] DEBUG: package[php-devel] installed version: 5.3.3-3.el6_2.8 candidate version: 5.3.3-3.el6_2.8
[Fri, 22 Jun 2012 12:43:31 +0000] DEBUG: package[php-devel] is already installed - nothing to do
@cburyta
cburyta / vport.zsh
Last active September 15, 2015 16:47
cli-function-vport: List VirtualBox ports used by a Vagrant driven machine.
#
# usage: use from in the directory that the .vagrant dir is, e.g...
# cd vagrant-project-root
# vagrant up
# vport
#
vport() {
pushd .vagrant/machines
for MACHINE in `find . -type d -mindepth 1 -maxdepth 1`
do
@cburyta
cburyta / fix-group-brew.sh
Last active August 29, 2015 14:19
Fix / set homebrew multiuser permissions
#!/bin/bash
# reference: http://blog.strug.de/2012/06/my-homebrew-multi-user-setup/
# usage: bash -c "$(curl -fsSL https://gist.githubusercontent.com/cburyta/9ecaa7463086c6484480/raw/4f756d43fd1b7aebccec6ea49f30dd3b3faf76f0/fix-group-brew.sh)"
# stop if brew doctor fails
set -e
echo "Ensure we have a 'brew' group, if not exists create the brew group before continuing."
dscl . -read /Groups/brew