Skip to content

Instantly share code, notes, and snippets.

View chriswessells's full-sized avatar

Chris Wessells chriswessells

View GitHub Profile
@chriswessells
chriswessells / vscode.md
Last active November 23, 2017 15:32
Visual Studio Code Notes

VScode

Extensions

  • MongoDB
  • GitLens
  • Ruby
@chriswessells
chriswessells / .profile
Created October 27, 2017 03:47
Setting up a vim IDE
#
# add this command to your .profile or .bash_profile
alias vim='tmux new-session -d 'vim' \; split-window -v \; resize-pane -D 13 \; split-window -h \; resize-pane -R 13 \; attach'
@chriswessells
chriswessells / mongoldb_extend_date.rb
Created March 8, 2017 02:41
Extend the ruby Date class to calculate the week function as MongoDB aggregations calculate the weeks
# Purpose: to extend the date class to match the week aggregation for MongoDB 3.2
#
require 'date'
class Date
def mongo_week_number
week_offset = 0
unless Date.new(self.year,1,1).wday == 0
week_offset = 7 - (Date.new(self.year,1,1).wday)
@chriswessells
chriswessells / fix_dylib.sh
Created March 6, 2017 23:13
Script that will fix dyld: Symbol not found: __cg_jpeg_resync_to_restart Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO Expected in: /opt/local/lib/libJPEG.dylib in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO Trace/BPT trap: 5
#!/bin/bash
#
# script to fix errors after installing spidermonkey javascript engine on OS X and you get errors
#
cd /usr/local/lib
sudo rm libgif.dylib
sudo ln -s /System/Library/Frameworks/ImageIO.framework/Resources/libGIF.dylib libGIF.dylib
sudo rm libjpeg.dylib
sudo ln -s /System/Library/Frameworks/ImageIO.framework/Resources/libJPEG.dylib libJPEG.dylib
sudo rm libtiff.dylib
@chriswessells
chriswessells / c9.io_setup_chefdk
Created March 2, 2017 02:30
Setup chefdk on c9.io
wget https://packages.chef.io/files/stable/chefdk/1.2.22/ubuntu/14.04/chefdk_1.2.22-1_amd64.deb
sudo dpkg -i chefdk_1.2.22-1_amd64.deb
echo 'eval "$(chef shell-init bash)"' >> ~/.profile
source ~/.profile
<#
PowerShell Script that updates the knife-windows bootstrap template so it installs chef as a service.
#>
$basePath = "C:\opscode\chefdk\embedded\lib\ruby\gems"
$folders = Get-ChildItem -Path $basePath
@chriswessells
chriswessells / NewRelicInsights.r
Created May 27, 2016 14:47
Querying NewRelic Insights with R
#
# Load the library to access the data
#
library(jsonlite)
library(httr)
# Header values required for accessing NewRelic
# ['X-Query-Key'] = 'NewRelicApi key'
#
@chriswessells
chriswessells / PowerShell-OS-Architecture
Last active August 29, 2015 13:56
PowerShell start of a script that get's the Operating System version and architecture
<#
.SYNOPSIS
Beginning of a script to do things specific to the Windows Operating System
.DESCRIPTION
I automate tasks often in a windows environment. This script can be customized for all Windows Operating Systems.
.NOTES
Author : Chris Wessells (chris@wessells.me)
.LINK
Script posted over:
http://wessells.me