Skip to content

Instantly share code, notes, and snippets.

View btorresgil's full-sized avatar

Brian Torres-Gil btorresgil

  • Palo Alto Networks
View GitHub Profile
@btorresgil
btorresgil / README.md
Last active March 18, 2021 21:56
GitHub Org IP Allow List API Calls

GitHub Org IP Allow List API Calls

examples.ts contains example graphql queries and mutations for working with the IP allow list

gql-paginate.ts contains a recursive function example to paginate a graphql query with more than 100 results

@btorresgil
btorresgil / README.md
Last active January 20, 2022 15:45
Run a Splunk server with Add-on Builder
@btorresgil
btorresgil / Deploy to gh-pages.md
Last active November 1, 2022 13:19
Deploy to gh-pages
  1. Add homepage to package.json
{
  "homepage": "https://user.github.io/repo"
}
  1. Install gh-pages npm package
img {
height: auto;
width: 100%;
/* even more control with max-width */
max-width: 720px;
/* max-height fixes stretching issues in safari/ios */
max-height: 200px;
}
html,body
{
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
overflow-x: hidden;
}
Object.fromEntries(
Object.entries(obj)
.filter(([key]) => ['foo', 'bar'].includes(key))
)
@btorresgil
btorresgil / publish.yaml
Last active January 14, 2020 23:55
GitHub Action: Deploy Babel or TypeScript project to npm and gpr, the right way
# Publish a Babel or TypeScript package to NPM and Github Package Repository
#
# This version triggers when you create a GitHub release in the repo
# Note there is no caching because currently caching is not supported
# for release events, only push and pull_request.
#
# Required secrets:
# NPM_TOKEN: A token for NPM with write access
name: Publish

To change all the directories to 755 (drwxr-xr-x):

find . -type d -exec chmod 755 {} \;

To change all the files to 644 (-rw-r--r--):

find . -type f -exec chmod 644 {} \;
const pick = (...props) => o => props.reduce((a, e) => ({ ...a, [e]: o[e] }), {});
@btorresgil
btorresgil / .bash_profile
Last active February 3, 2020 22:54
Shell environment for python
### These next lines were added in the steps above
# pyenv
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
# pipx
export PATH="~/.local/bin:$PATH"