Skip to content

Instantly share code, notes, and snippets.

{
"method": "POST",
"url": "https://auth.quiltt.io/v1/session",
"httpVersion": "HTTP/1.1",
"headers": [
{ "name": "Accept", "value": "application/json" },
{ "name": "Content-Type", "value": "application/json" }
],
"postData": {
"mimeType": "application/json",
git config --global user.name "Zane Wolfgang Pickett"
git config --global user.email "sirwolfgang@users.noreply.github.com"
git config --global color.ui true
git config --global core.editor nano
git config --global credential.helper cache
git config --global credential.helper 'cache --timeout=3600'
git config --global core.autocrlf input
@sirwolfgang
sirwolfgang / bash.sh
Last active January 25, 2019 00:30
Git OSX
curl https://raw.githubusercontent.com/github/gitignore/master/Global/macOS.gitignore > ~/.gitignore
git config --global core.excludesfile ~/.gitignore
@sirwolfgang
sirwolfgang / swap.c
Last active March 20, 2018 18:09
Single Line Butterfly Swap
void Swap(byte& _A, byte& _B)
{
_A ^= _B ^= _A ^= _B;
}
@sirwolfgang
sirwolfgang / snippets.sql
Created January 31, 2018 18:18
Postgres
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE datname = current_database()
AND pid <> pg_backend_pid();
# frozen_string_literal: true
# @see https://gist.github.com/ryanlecompte/1283413
module BeforeSingletonAction
extend ActiveSupport::Concern
class_methods do
def singleton_method_added(method_name)
return if before_singleton_actions.include?(method_name) || before_singleton_action_methods.include?(method_name)
@sirwolfgang
sirwolfgang / .bash_profile
Last active June 7, 2017 21:10
Color Bash Prompts
# Environment
PS1='\[\e[0;32m\]\u@\h\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[1;32m\]\$\[\e[m\] '
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
# Ruby
source /usr/local/opt/chruby/share/chruby/chruby.sh
chruby ruby-2.3.1
RSpec.configure do |config|
# Add VCR to all tests
config.around(:each) do |example|
options = example.metadata[:vcr] || {}
if options[:record] == :skip
VCR.turned_off(&example)
else
name = example
.metadata[:full_description]
# frozen_string_literal: true
module ClassCacheKey
extend ActiveSupport::Concern
module ClassMethods
def cache_key(scope = all)
timestamp = DateTime.new(scope.maximum(:updated_at).to_i).utc.to_s(:number)
scope_sql = Digest::SHA1.hexdigest(scope.to_sql)
"#{model_name.cache_key}::#{scope_sql}\##{scope.count}-#{timestamp}"
end
[ -f /usr/src/app/VERSION ] && export APP_VERSION="$(cat /usr/src/app/VERSION)"