This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Bryan Brophy | |
email = brybrophy@gmail.com | |
[alias] | |
c = commit -m | |
st = status --short --branch | |
ca = commit --amend --reuse-message=HEAD | |
ce = commit --allow-empty -m | |
co = checkout | |
br = branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>ANSIBlackColor</key> | |
<data> | |
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS | |
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECQw | |
LjUwMTk2MDgxNCAwLjUwMTk2MDgxNCAwLjUwMTk2MDgxNAAQAYAC0hAREhNaJGNsYXNz | |
bmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFyY2hpdmVy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To make this work like Ryan's original fish shell, install the following ZSH plugins and use the sobol.zsh-theme. | |
https://github.com/zsh-users/zsh-autosuggestions | |
https://github.com/zsh-users/zsh-syntax-highlighting | |
Add this command to your zshrc file. | |
alias gbra="git branch | grep -v "master" | grep -v "main" | xargs git branch -D" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
For an enum of country codes to countries, | |
See https://gist.github.com/evolkmann/740d24889c509c08484a8ff72af5dd64 | |
*/ | |
/* | |
For an enum of countries to country codes, | |
See https://gist.github.com/kyranjamie/646386d5edc174e8b549111572897f81 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createLoggedFunction(fn) { | |
function loggedFunction(...args) { | |
const nowUtc = new Date().getTime(); | |
console.log('----Start----'); | |
console.log(`Function ${fn.name} was called with ${args} at ${nowUtc}`); | |
console.log('-----End-----'); | |
return fn(...args); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function palindromeRearranging(inputString) { | |
const charCounts = [...inputString].reduce((counts, char) => { | |
counts[char] = counts[char] ? counts[char] + 1 : 1; | |
return counts; | |
}, {}); | |
return Object.values(charCounts).filter(count => count % 2 !== 0).length <= 1; | |
} | |
// First get the character count for each character in the string and store it in an object. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isCryptSolution(crypt, solution) { | |
let hasLeadingZeros = false; | |
const decrypted = crypt.map(word => { | |
const number = word.split('').map(letter => { | |
return solution.find(key => key[0] === letter)[1]; | |
}).join(''); | |
if (number.startsWith('0') && number.length > 1) { | |
hasLeadingZeros = true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sudoku2(grid) { | |
return ( | |
validateRows(grid) && | |
validateRows(rotateGrid(grid)) && | |
validateSubGrids(grid) | |
); | |
} | |
// Validate each row. | |
function validateRows(grid) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import SmartComponent from './SmartComponent'; | |
export default class App extends Component { | |
render() { | |
return <SmartComponent name="World" />; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { action, observable } from 'mobx'; | |
import { observer } from 'mobx-react'; | |
@observer | |
export default class User extends Component { | |
@observable user = { | |
firstName: 'john', | |
lastName: 'lennon', | |
status: 'alive' |
NewerOlder