Skip to content

Instantly share code, notes, and snippets.

View apcomplete's full-sized avatar

Alex Padgett apcomplete

View GitHub Profile

RTK Query

What is RTK Query?

  • RTK Query is a powerful data fetching and caching tool. It is designed to simplify common cases for loading data in a web application, eliminating the need to hand-write data fetching & caching logic yourself.
  • It's built on top of RTK, namely createAsyncThunk and createSlice.

TLDR: Abstraction of fetching logic + caching

What are the major features of RTK Query?

@apcomplete
apcomplete / BreweryNotes.mkd
Last active January 3, 2020 15:39
Pro-brewer notes

Beer and Brewing Podcast notes

  • 1 bbl = 31 gal
  • 4lb/bbl = 2.06oz/gal

Aslin

  • Dry hop around 65*F
  • Layer whirlpool hops based on character at different temperatures. Some oils break down at higher temps.
  • Dry hop post-fermentation
  • No bittering additions in the brewery
@apcomplete
apcomplete / client.app.js
Last active August 29, 2015 14:18
iris money formatting
require('./helpers');
.....
@apcomplete
apcomplete / array_input.coffee
Created March 27, 2014 17:33
Ember easyForm array input using Zurb Foundation
Ember.EasyForm.ArrayInput = Ember.View.extend
classNames: ["row"]
templateName: 'easyForm/array_input'
valueItems: (->
@get('value').map (item) ->
{ value: item }
).property()
@apcomplete
apcomplete / resource.rb
Last active December 29, 2015 03:19
Shared example for request specs
require 'spec_helper'
describe "Scrapbooks" do
context 'beta user' do
before do
@user = FactoryGirl.create :user, :confirmed, roles: [:beta]
@resource = FactoryGirl.create :scrapbook, user: @user
@other_resource = FactoryGirl.create :scrapbook
end
@apcomplete
apcomplete / gist:6800017
Created October 2, 2013 20:26
AppleScript for displaying OSX notifications when receiving a message in Messages without displaying the message text in the notification.
using terms from application "Messages"
on message received theMessage from theBuddy for theChat
tell application "Notifications Scripting"
-- This is required for calling the user notification event handlers. The handlers can be in a different script file.
set event handlers script path to (path to me)
-- The user info parameter is a record. The supported data types are text, integer, real, boolean, date, alias, file and POSIX file.
set dict to {theName:"Notifications Scripting", theVersion:"1.0", theScript:event handlers script path}
display notification "New Message" subtitle "From " & (theBuddy's name as string) message "" sound name "Default" user info dict
@apcomplete
apcomplete / app_builder.rb
Last active December 16, 2015 09:49
App Template
client = ask "What's the client name for this project?"
job = ask "What's the job number for this project?"
install_devise = yes? "Do you want to use devise?"
install_rails_admin = yes? "Do you want to use rails_admin?"
gem 'rails-backbone'
gem 'thin'
gem 'capybara', group: [:test,:development]
gem 'rspec-rails', group: [:test,:development]
gem 'faker', group: [:test,:development]
@apcomplete
apcomplete / gist:5205282
Created March 20, 2013 14:53
jquery.hotspot, plugin for scalable overlaying of clickable hotspots on an image
(function( $ ){
var methods = {
init: function(opts){
var opts = $.extend({
scale: 1
}, opts);
return this.each(function() {
var $this = $(this)
, spots = $this.children('div.hotspot')
, image = $this.children('img')
@apcomplete
apcomplete / gist:5187630
Created March 18, 2013 14:42
bash script for being too lazy to cd into sites directory (with autocompletion)
_sites () {
local client project
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
if [ $prev == "sites" ]
then
COMPREPLY=( $(compgen -W "$(ls /Users/alex/Sites/)" -- $cur) );
else
COMPREPLY=( $(compgen -W "$(ls "/Users/alex/Sites/$prev")" -- $cur));
@apcomplete
apcomplete / Backtrace.js
Last active July 21, 2018 08:11
Simple backbone routing without hash URLs
r(function() {
Backtrace = {};
Backtrace.Router = (function() {
Router.prototype.optionalParam = /\((.*?)\)/g;
Router.prototype.namedParam = /:\w+/g;