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 / 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
@cburyta
cburyta / mymod.php
Last active August 29, 2015 14:02
Drupal Hook Menu Stuff
<?php
function mymod_menu() {
$items = array();
// the 3rd arg is a %, meaning its dynamic - in page and access arguments its the '2' value, based on 0/1/2
// url parts are separated by /'s
// the first part is 0
// the second is 1
// the third is 2 (goes up from there)
@cburyta
cburyta / keybase.md
Created June 13, 2014 12:02
keybase.md

Keybase proof

I hereby claim:

  • I am cburyta on github.
  • I am cburyta (https://keybase.io/cburyta) on keybase.
  • I have a public key whose fingerprint is 1C4B 52E1 94ED AE0A 8114 A1FA 3E02 C3C7 D7DA 68A9

To claim this, I am signing this object:

@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]