Skip to content

Instantly share code, notes, and snippets.

View juliantrueflynn's full-sized avatar

Julian Flynn juliantrueflynn

View GitHub Profile
@juliantrueflynn
juliantrueflynn / babelTransform.js
Created May 19, 2021 16:06
jest preset example
const babelJest = require('babel-jest');
module.exports = babelJest.createTransformer({
presets: [require.resolve('babel-preset-react-app')],
babelrc: false,
configFile: false,
});
@juliantrueflynn
juliantrueflynn / .bash_profile
Created July 7, 2019 23:33
Bash scripts I use for Macbooks
# Get current git branch name
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# Format Terminal input prefix
export PS1="\W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
# Load RVM into a shell session *as a function*
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
@juliantrueflynn
juliantrueflynn / Dropdown.jsx
Last active July 29, 2018 17:43
React Dropdown component using onBlur, onFocus, onMouseDown
import React from 'react';
class Dropdown extends React.Component {
constructor(props) {
super(props);
this.state = { isDropdownOpen: false };
this.handleOpen = this.handleOpen.bind(this);
this.handleClose = this.handleClose.bind(this);
this.handleDropdownClick = this.handleDropdownClick.bind(this);
this.handleTogglerClick = this.handleTogglerClick.bind(this);