Skip to content

Instantly share code, notes, and snippets.

Avatar

Shane McDonald shanemcd

View GitHub Profile
@shanemcd
shanemcd / Dockerfile
Created Apr 19, 2018
Example showing how to run a Node Server using the Node SCL
View Dockerfile
FROM centos:7
RUN yum install -y centos-release-scl-rh
RUN yum-config-manager --enable rhel-server-rhscl-7-rpms
RUN yum install -y scl-utils rh-nodejs8
RUN curl -Lo app.js https://gist.githubusercontent.com/conifertw/3719759/raw/9031d13eef36686f39b1e453dfc6529064cbaf61/gistfile1.js
RUN sed -i 's/127.0.0.1/0.0.0.0/g' app.js
View build.log.gz
Mock Version: 1.3.4
ENTER ['do'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target x86_64 --nodeps /builddir/build/SPECS/erlang.spec'], shell=FalseprintOutput=FalsechrootPath='/var/lib/mock/epel-7-x86_64-mockbuilder-6128/root'nspawn_args=[]uid=1001gid=135timeout=0logger=<mockbuild.trace_decorator.getLog object at 0x7f2b6df2d828>user='mockbuild'env={'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PS1': '<mock-chroot> \\s-\\v\\$ ', 'SHELL': '/bin/bash', 'PROMPT_COMMAND': 'printf "\\033]0;<mock-chroot>\\007"', 'TERM': 'vt100', 'LANG': 'en_US.UTF-8', 'HOME': '/builddir', 'HOSTNAME': 'mock'})
Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target x86_64 --nodeps /builddir/build/SPECS/erlang.spec'] with env {'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PS1': '<mock-chroot> \\s-\\v\\$ ', 'SHELL': '/bin/bash', 'PROMPT_COMMAND': 'printf "\\033]0;<mock-chroot>\\007"', 'TERM': 'vt100', 'LANG': 'en_US.UTF-8', 'HOME': '/builddir', 'HOSTNAME': 'mock'} and shell False
warning: bogus date in %changelog:
@shanemcd
shanemcd / etc.fstab
Last active Dec 4, 2016 — forked from vadviktor/etc.fstab
Ubuntu guest VMware shared folders using open-vm-tools package and vmhgfs-fuse
View etc.fstab
.host: /mnt fuse.vmhgfs-fuse allow_other,uid=1000,gid=1000,auto_unmount,defaults 0 0
View keybase.md

Keybase proof

I hereby claim:

  • I am shanemcd on github.
  • I am shanemcd (https://keybase.io/shanemcd) on keybase.
  • I have a public key whose fingerprint is C0D6 7E46 E506 8B11 6212 1457 5DF2 ED93 B72A C963

To claim this, I am signing this object:

View async_ruby_example.rb
require 'rubygems'
require 'doc_raptor'
TEN_SECONDS = 10
FIVE_MINUTES = 300
DocRaptor.api_key "YOUR_API_KEY_HERE"
pdf_html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html lang="en"><body><a href="http://google.com">google</a></body></html>'
View gist:6538369
# routes.rb
get '/:campaign' => 'campaigns#show', constraints: CampaignConstraint.new
# lib/campaign_constraint.rb
class CampaignConstraint
def matches?(request)
Campaign.exists?(name: request.params[:campaign])
end
end
View gist:6274218
@mixin background-image-retina($file, $type, $width, $background-repeat: no-repeat) {
background-image: image-url($file + '.' + $type);
width: $width;
background-repeat: $background-repeat;
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 144dpi) {
& {
background-image: image-url($file + '@2x.' + $type);
background-size: $width;
}
@shanemcd
shanemcd / gist:5535944
Last active Dec 17, 2015
Best Clearfix
View gist:5535944
.clearfix {
zoom: 1;
clear: both;
}
.clearfix:before, .clearfix:after {
content: "\0020";
display: block;
height: 0;
overflow: hidden;
View gist:5128603
function pkill() {
for X in `ps acx | grep -i $1 | awk {'print $1'}`; do
kill $X;
done
}
@shanemcd
shanemcd / gist:4718496
Created Feb 5, 2013
Prevent scrolling
View gist:4718496
body{
overflow: hidden;
}