Skip to content

Instantly share code, notes, and snippets.

@jrdn91
jrdn91 / bad-example.tsx
Last active July 10, 2023 15:59
Search results useQuery example
const [search, setSearch] = useState("")
const debouncedSearch = useDebounce(search, 400)
const [searchResults, setSearchResults] = useState<Agent[]>([])
const { data: agents, isLoading } = useListAgents({
search: debouncedSearch,
})
useEffect(() => {
setSearchResults(() => agents || [])
@jrdn91
jrdn91 / README.MD
Created November 12, 2021 21:30
Contributing doc

Event Gives Versioning

Visual for "standard" git versioning

Versioning visual

Main Branch

Main will always be our production branch and it should not be committed to directly. Only branch off for hotfixes, or in rare cases, hard resetting development. The only branches to be merged into Main are release branches, because the only commits that should be made to master are full releases.

@jrdn91
jrdn91 / extractFromAddress.js
Created April 29, 2020 13:36
Extract Google Places Data
export default (components, type, part = "long_name") => {
for (var i = 0; i < components.length; i++) {
for (var j = 0; j < components[i].types.length; j++) {
if (components[i].types[j] === type) return components[i][part]
}
}
return ""
}
@jrdn91
jrdn91 / server.js
Created January 14, 2020 15:32
Mirage setup
import { Server, Model, Response } from "miragejs"
import {
consortiaFixtures,
statusFixtures,
typeFixtures,
enrollmentFixtures
} from "./fixtures"
var jwt = require("jsonwebtoken")
export function makeServer({ environment = "development" } = {}) {
@jrdn91
jrdn91 / index.js
Created February 11, 2019 20:42
Login Page
import React from 'react';
import { connect } from 'react-redux';
import { Container, Button, Form, Item, Input, Label } from 'native-base';
import {
NativeModules,
LayoutAnimation,
Animated,
View,
Keyboard,
ScrollView,
@jrdn91
jrdn91 / npm-debug.log
Created May 22, 2018 17:15
Material UI Next Docs Error
0 info it worked if it ends with ok
1 verbose cli [ '/Users/jordanriser/.nvm/versions/node/v6.11.2/bin/node',
1 verbose cli '/Users/jordanriser/.nvm/versions/node/v6.11.2/bin/npm',
1 verbose cli 'start' ]
2 info using npm@3.10.10
3 info using node@v6.11.2
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle material-ui@1.0.0-beta.35~prestart: material-ui@1.0.0-beta.35
6 silly lifecycle material-ui@1.0.0-beta.35~prestart: no script for prestart, continuing
7 info lifecycle material-ui@1.0.0-beta.35~start: material-ui@1.0.0-beta.35
@jrdn91
jrdn91 / print.js
Created November 14, 2017 14:22
JSONAPI Server Custom Handler
// RESOURCES/PRINT.JS
var jsonApi = require("jsonapi-server");
var printHandler = require("../handlers/printHandler.js");
let PrintHandler = new printHandler();
jsonApi.define({
resource: "print",
handlers: PrintHandler,
@jrdn91
jrdn91 / jQuery: Firefox Scaling Fix
Created November 20, 2013 21:36
I wrote this little snippet to account for Firefox 22+ scaling sites larger on Windows to honor window DPI scaling settings. Requires the browser plugin found here... http://jquery.thewikies.com/browser/
var windows = (navigator.platform.toLowerCase() == 'win16' || navigator.platform.toLowerCase() == 'win32') ? true : false;
console.log(windows);
if($.browser.name == 'firefox' && $.browser.versionNumber >= 22 && windows == true){
$('html').css('-moz-transform', 'scale(0.8)');
}
$(document).ready(function() {
function filterPath(string) {
return string
.replace(/^\//,'')
.replace(/(index|default).[a-zA-Z]{3,4}$/,'')
.replace(/\/$/,'');
}
var locationPath = filterPath(location.pathname);
var scrollElem = scrollableElement('html', 'body');
@jrdn91
jrdn91 / CSS: LightCMS Custom Suckerfish
Last active December 21, 2015 08:49
Css snippet to customize the lightcms suckerfish bars
.roundedTop, .roundedTop .rLeft, .roundedMiddle, .roundedMiddle .rLeft, .roundedBottom, .roundedBottom .rLeft {
background: transparent !important;
}
.actions, .inlineContentAdder {
background: #333 !important;
}
.inlineContentAdder a.vwInitialAdd, .inlineContentAdder a.vwInitialAdd:link {
border-left: 3px solid #1cd971 !important;
background: transparent !important;
}