Skip to content

Instantly share code, notes, and snippets.

const getWeekNum = (date) => {
// create new Date obj to avoid mutating input
const now = new Date(date.getUTCFullYear(), date.getMonth(), date.getDate());
now.setMilliseconds(0);
const yearStart = new Date(now.getUTCFullYear(), 0, 1);
const milisecsInWeek = 7 * 24 * 60 * 60 * 1000;
return Math.floor((now.valueOf() - yearStart.valueOf()) / milisecsInWeek) + 1;
};
# dependencies
node_modules
# logs
npm-debug.log
# Environment config
.env
# Editors
@phirework
phirework / .bashrc
Last active December 29, 2019 20:47
# source ~/git-prompt.sh --> get from: https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
red='\[\e[31m\]'
grn='\[\e[32m\]'
yel='\[\e[33m\]'
blu='\[\e[34m\]'
mag='\[\e[35m\]'
cyn='\[\e[36m\]'
@phirework
phirework / music with female vocalists
Last active September 14, 2018 14:35
Female/female-fronted acts
* = also endorsed by me
() = number of recs
[] = recommend starting point
---
Cat Power (x4)
Janelle Monae* (x4) [Archandroid]
PJ Harvey (x4)
Alabama Shakes* (x3)

Keybase proof

I hereby claim:

  • I am phirework on github.
  • I am phirework (https://keybase.io/phirework) on keybase.
  • I have a public key ASDwopnmhkZ4DkUHwgBaoIbV4XviH0HHWGyNumLZ_thNZAo

To claim this, I am signing this object:

@phirework
phirework / gist:19c2c633e42cd3930418
Created September 3, 2014 21:40
Graphite deployment steps
=== PREP
1. Make sure everyone has their work merged into QA
2. Make sure no one is using the QA server
=== DRY RUN PROCEDURE
1. Git steps
a. git checkout prod_currentversion (eg. prod_v2.5)
b. git pull origin
c. git branch prod_currentrelease (eg. prod_v2.6)
@phirework
phirework / nginx config
Created January 13, 2014 22:40
nginx configuration for virtual sites
# If you installed nginx with homebrew, go to /usr/local/etc/nginx, and create these directories:
mkdir sites-available
mkdir sites-enabled
# Add the following to nginx.conf before the final }
include /usr/local/etc/nginx/sites-enabled/*;
# Put your virtual host config files in ./sites-available and symlink as necessary
ln -s /sites-available/custom.conf /sites-enabled/custom.conf
@phirework
phirework / settings.php
Created January 13, 2014 22:35
Drupal settings.php
// Add this to bottom of default settings.php file
error_reporting(E_ALL & ~E_STRICT);
ini_set('memory_limit', '1024M');
set_time_limit(120);
@phirework
phirework / Notes for local Drupal setup
Created January 13, 2014 22:32
Setting up local Drupal install with nginx and drush
# Install drush by unzipping drush in home directory
# https://drupal.org/node/1674222
# Add this to your .bash_profile
alias drush="DRUSH_DIRECTORY/drush.php"
# Set error reporting (navigate to drupal home directory)
drush vset error_level 2 --yes
# Create user, assigining privileges
create user 'USER'@'localhost' identified by 'PASSWORD'
@phirework
phirework / .gitconfig
Last active November 13, 2019 21:37
Default git config file
[alias]
co = checkout
cb = checkout -b
br = branch
st = status
cp = cherry-pick
rs = reset --hard HEAD
vh = log --invert-grep --committer="AUTHOR\\ NAME" --pretty=format:"%C(yellow)%h\\ %C(magenta)%ad\\ %C(cyan)%<|(35)%cn\\ %Cred%d\\ %Creset%s" --decorate --date=short -20
hist = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short -20
histq = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short -n