Skip to content

Instantly share code, notes, and snippets.

View adamweeks's full-sized avatar

Adam Weeks adamweeks

View GitHub Profile
isZero(0)
zero!
FINALLY
isZero()
not zero
FINALLY
error caught
@adamweeks
adamweeks / .bash_prompt
Created May 2, 2019 18:50
Bash prompt that shows current node version and git status
RED_COLOR="\[$(tput setaf 1)\]"
YELLOW_COLOR=""
END_COLOR="\[$(tput sgr0)\]"
function __git_dirty {
git diff --quiet HEAD &>/dev/null
[ $? == 1 ] && echo " ↺ "
}
function __git_branch {
#Colorful Terminal
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
export CLICOLOR=1
# Aliases
alias ll="ls -al";
alias ..="cd ../";
alias ..l="cd ../ && ll";
alias vb="vim ~/.bash_profile";
alias sb="source ~/.bash_profile";
@adamweeks
adamweeks / fl-amendments.md
Last active October 12, 2018 14:45
2018 Florida Amendments
  • Amendment 1: Increased Homestead Property Tax Exemption
    • No - tax cuts for homeowners with nothing equalizing
  • Amendment 2: Limitations on Property Tax Assessments
    • Yes - Reduces volatility in property tax changes
  • Amendment 3: Voter Control of Gambling in Florida
    • No - Limits gambling control and makes everyone vote for existing gambling changes
    • Note: I'm very torn on this one and may change my mind before voting
  • Amendment 4: Voting Restoration
    • Yes - People have paid their debts to society with jail time
  • Amendment 5: Supermajority Vote Required to Impose, Authorize, or Raise State Taxes or Fees
@adamweeks
adamweeks / params.js
Created January 6, 2017 16:56
eslint-disable-reason
// eslint-disable-reason legacy API passes all of these params
// eslint-disable max-params
const processData = (a1, b2, c3, d4, e5) => a1+b2+c3+d4+e5;
@adamweeks
adamweeks / promise-failure.js
Last active October 28, 2016 20:35
A quick function that returns a failure after 2 seconds.
function testFailure() {
return new Promise((resolve, reject) => {
setTimeout(() => {
reject();
}, 2000);
});
}

Keybase proof

I hereby claim:

  • I am adamweeks on github.
  • I am adamweeks (https://keybase.io/adamweeks) on keybase.
  • I have a public key whose fingerprint is 4711 16EE 3DDE 01D9 36FE 7E11 749D 236F BECA CB30

To claim this, I am signing this object:

@adamweeks
adamweeks / package.json
Created January 21, 2016 19:59
NPM Script to eslint against staged changes
"scripts": {
"eslint": "eslint -c .eslintrc $(git diff --staged --diff-filter=ACMTUXB --name-only -- '*.js'); exit 0"
}
@adamweeks
adamweeks / javascript.json
Created January 15, 2016 16:15
ESLint Disable Line snippet for VS Code
{
"ESLint Disable Line": {
"prefix": "eslignore",
"body": [
"//eslint-disable-line"
],
"description": "Disable ESLint for the given line"
}
}
@adamweeks
adamweeks / ServiceTemplate.js
Created September 29, 2015 15:52
Angular Service Template for Webstorm
(function() {
'use strict';
angular.module('${moduleName}', [])
.service('${serviceName}', [${serviceName}]);
function ${serviceName}() {
var service = this;
}
})();