Skip to content

Instantly share code, notes, and snippets.

View cmbirk's full-sized avatar

Chris Birk cmbirk

View GitHub Profile
import {SecretManagerServiceClient} from '@google-cloud/secret-manager'
const projectId = 'project-id'
// Instantiates a client
const client = new SecretManagerServiceClient();
export const accessSecretVersion = async (secretName) => {
const [version] = await client.accessSecretVersion({
@cmbirk
cmbirk / jekyll-generator.sh
Created April 20, 2016 22:52
Creating new jekyll site with detached gh-pages branch
#!/bin/bash
##
# Based on the blog post at http://www.aymerick.com/2014/07/22/jekyll-github-pages-bower-bootstrap.html
##
echo "Please enter the github repository url ( git@github.com:<user>/<repo>.git ): "
read GIT_REPO
BASENAME=$(basename $GIT_REPO)
@cmbirk
cmbirk / keybase.md
Last active September 5, 2017 20:49

Keybase proof

I hereby claim:

  • I am cmbirk on github.
  • I am cmbirk (https://keybase.io/cmbirk) on keybase.
  • I have a public key ASDxvDda42TMGq5vR47A0_1Ydq36iLJvnGojuiyFloPwcAo

To claim this, I am signing this object:

@cmbirk
cmbirk / style.txt
Created January 26, 2016 18:39
Testing Styling for ep_better_pdf_export
body {
color:blue;
}
@cmbirk
cmbirk / es.sh
Created January 7, 2014 19:58 — forked from rajraj/es.sh
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
#!/bin/bash
filedir=$1;
echo "Starting converstion to mp4 script"
if [ -d "$filedir" ]; then
cd "$filedir"
for file in ./* ;
do
if [[ $file = *.mkv || $file = *.avi ]] ; then
@cmbirk
cmbirk / gist:6545739
Created September 13, 2013 00:54
PHP script to strip entities from XML
<?php
$unconvertedEntity = array(
'&percnt;',
'&numsp;',
'&lowbar;'
);
$convertedChar = array(
'%',
' ',
'_'
parse_str(file_get_contents("php://input"),$post_vars);
@cmbirk
cmbirk / laravel_debug_route
Created March 22, 2013 20:29
Debug Laravel Controller Call
public function __call($method, $parameters){
return dd(Request::route());
}
@cmbirk
cmbirk / center_box.js
Created January 14, 2013 16:24
Center Lightbox with jQuery
//Center Lightbox
function center_box(){
var body = $('body')[0];
var box_height = $('#lightbox').height();
var box_width = $('#lightbox').width();
var screen_height = $(body).height();
var screen_width = $(body).width();
var top = (screen_height / 2) - (box_height / 2);
var left = (screen_width / 2) - (box_width / 2);