Skip to content

Instantly share code, notes, and snippets.

"zip": "zip -r -X docs-dist.zip dist && open https://your.site.com/ && open ."
@JackFGreen
JackFGreen / brew-list.sh
Created August 5, 2021 06:46 — forked from eguven/brew-list.sh
List all packages installed using Homebrew and their sizes
brew list --formula | xargs -n1 -P8 -I {} \
sh -c "brew info {} | egrep '[0-9]* files, ' | sed 's/^.*[0-9]* files, \(.*\)).*$/{} \1/'" | \
sort -h -r -k2 - | column -t
#!/bin/sh
git filter-branch --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "[Your Old Email]" ]
on alfred_script(q)
if application "iTerm2" is running or application "iTerm" is running then
run script "
on run {q}
tell application \"iTerm\"
try
create window with default profile
set onlywindow to true
on error
create window with default profile
@JackFGreen
JackFGreen / alfred-iterm
Created July 7, 2019 08:34
always use create window with default profile
on alfred_script(q)
if application "iTerm2" is running or application "iTerm" is running then
run script "
on run {q}
tell application \":Applications:iTerm.app\"
activate
try
create window with default profile
on error
create window with default profile
@JackFGreen
JackFGreen / jsconfig.json
Last active April 10, 2019 10:27
path intellisense
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@src/*": ["src/*"],
"@packages/*": ["src/packages/*"],
"@components/*": ["src/components/*"],
"@tools/*": ["src/tools/*"],
"@constant/*": ["src/constant/*"],
"@submodules/*": ["submodules/*"]
@JackFGreen
JackFGreen / delete_git_submodule.md
Created April 10, 2019 09:44 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@JackFGreen
JackFGreen / .browserslistrc
Created February 13, 2019 04:09
rc config
>0.25%
ie 11
not op_mini all
/**
* build to env
*/
const shell = require('shelljs')
const inquirer = require('inquirer')
const packageInfo = require('../package.json')
const fs = require('fs')
const path = require('path')
const compareVersions = require('compare-versions')
@JackFGreen
JackFGreen / handleApiResponse.js
Created January 9, 2019 13:19
handle api response
/**
* handle api response
* @param {Object} res api response
* @param {Object} options handler res
* @param {Function} options.success
* @param {Object} options.fail each code with handler { code: handler }
* @param {Function|Boolean} options.error
*/
export function handleApiRes (res, { success, fail = null, error = true } = {}) {
const code = res.code