Skip to content

Instantly share code, notes, and snippets.

ChristianEspinoza chespinoza

Block or report user

Report or block chespinoza

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View mainpython.md

The use of __main__.py to create executables

myprojectfolder/
    |_ __main__.py
    |_ __init__.py

Being __main__.py:

print("Hello")
@chespinoza
chespinoza / cond-example.clj
Created Apr 21, 2019 — forked from Engelberg/cond-example.clj
refactoring with better-cond
View cond-example.clj
; The sample to refactor
(if-let [x (foo)]
(if-let [y (bar x)]
(if-let [z (goo x y)]
(do
(qux x y z)
(log "it worked")
true)
(do
(log "goo failed")
View read-csv-file.clj
(with-open [rdr (reader "my/file.csv")]
(->> rdr
(line-seq)
(map #(split % #","))))
View pipenv_shell_script.sh
cat << EOF >> Pipfile
[scripts]
echospam = "echo I am really a very silly example"
EOF
pipenv run echospam
>> I am really a very silly example
@chespinoza
chespinoza / ADR.md
Created May 21, 2018
Architecture Decision Record
View ADR.md

[short title of solved problem and solution]

  • Status: [accepted | superseeded by ADR-0005 | deprecated | …]
  • Deciders: [list everyone involved in the decision]
  • Date: [YYYY-MM-DD when the decision was last updated]

Technical Story: [description | ticket/issue URL]

Context and Problem Statement

@chespinoza
chespinoza / docker-cleanup-resources.md
Created May 18, 2018 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks
View docker-cleanup-resources.md

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
@chespinoza
chespinoza / multiple_ssh_setting.md
Last active May 11, 2018 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts
View multiple_ssh_setting.md

Multiple SSH Keys settings for different github account

restart ssh-agent

killall ssh-agent; eval `ssh-agent`

create different public key

View device_keys.json
{
"user_public_key": "BqgnKMqz9xHScQyV3ZbUBWgrMUhhshQofkrCPfMz6YBm",
"device_secret_key": "7LfmvQpwPDCVA5MwcusomzFGTeE5Zsn3tyNFQtUU9M7C"
}
@chespinoza
chespinoza / gist:576f1cc0819c8a10c4a8b3c5c24344c6
Created Sep 5, 2017 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
View gist:576f1cc0819c8a10c4a8b3c5c24344c6
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
You can’t perform that action at this time.