Skip to content

Instantly share code, notes, and snippets.

View CurtisHumphrey's full-sized avatar

Curtis M. Humphrey, Ph.D. CurtisHumphrey

View GitHub Profile
@CurtisHumphrey
CurtisHumphrey / title.txt
Created February 16, 2024 15:47
iTerm2 window title
\(currentTab.currentSession.path) - \(currentTab.title)
@CurtisHumphrey
CurtisHumphrey / noErrorLogs.js
Created August 30, 2018 21:51
nightwatch.js assertion for no browser logs
/**
* Checks if the given element exists in the DOM.
*
* ```
* this.demoTest = function (client) {
* browser.assert.noErrorLogs()
* }
* ```
*
* @method noErrorLogs
@CurtisHumphrey
CurtisHumphrey / index.esj
Created April 5, 2016 19:32
getsentry switching projects
<!-- the normal html -->
<%= htmlWebpackPlugin.options.raven %>
</body>
</html>
@CurtisHumphrey
CurtisHumphrey / WrapMany-spec.js
Last active October 17, 2016 07:12
Testing a React component that is a wrapper with enzyme with chai-enzymes
import React from 'react'
import {
shallow,
} from 'enzyme'
import WrapMany from './WrapMany'
describe('<WrapMany />', () => {
let sandbox
@CurtisHumphrey
CurtisHumphrey / npm.md
Created February 29, 2016 13:42
installing eslint for React using standard to use with sublime linter

npm -g i eslint eslint-config-standard eslint-config-standard-jsx eslint-config-standard-react eslint-plugin-flow-vars eslint-plugin-promise eslint-plugin-react eslint-plugin-standard babel-eslint

@CurtisHumphrey
CurtisHumphrey / styles.spec.js
Last active September 11, 2016 20:29
Testing for styles using React, react-css-modules, and enzyme with chai-enzymes
import React from 'react'
import {
shallow,
render,
} from 'enzyme'
import _ from 'lodash'
import Component from './Component'
import stylesClass from './Component.scss'
// Step 1: this next line is important since the finders expect a '.' at the string start
@CurtisHumphrey
CurtisHumphrey / DumbComponent.spec.js
Last active March 25, 2016 11:00
React Dump Component Standard Testing Patterns
import React from 'react'
import {
shallow
} from 'enzyme'
describe('<DumbComponent />', () => {
let sandbox
let props
beforeEach(() => {
@CurtisHumphrey
CurtisHumphrey / firebase_verbose.coffee
Created April 24, 2015 12:51
Add debug output to firebase get and sets
# Debuging path access
old_get = fb.core.Repo.prototype.addEventCallbackForQuery
fb.core.Repo.prototype.addEventCallbackForQuery = (query, eventRegistration) ->
console.log "get " + query.path.pieces_.join '/'
old_get.call @, query, eventRegistration
old_set = fb.core.Repo.prototype.setWithPriority
fb.core.Repo.prototype.setWithPriority = (path, newVal, newPriority, onComplete) ->
console.log "set " + path.pieces_.join '/'
old_set.call @, path, newVal, newPriority, onComplete
@CurtisHumphrey
CurtisHumphrey / check_temp_password
Created March 2, 2015 16:13
example from if-firebase-auth
login: function(user) {
return $q(function(resolve, reject) {
BACKEND.authWithPassword(user, function(error, authData) {
if (error === null) {
// user authenticated with Firebase
getUserData(authData);
temporaryPassword = authData.password.isTemporaryPassword;
authServiceError = {};
resolve('logged in');
} else {
@CurtisHumphrey
CurtisHumphrey / exists.coffee
Created July 19, 2014 15:54
Firebase check for existance
Check_Event: (ref, child, callback) ->
ref
.child child
.once 'value', (snapshot) ->
exists = snapshot.val() isnt null
callback exists
return