Skip to content

Instantly share code, notes, and snippets.

@dannberg
dannberg / obsidian-daily-note-template.txt
Last active April 24, 2025 16:36
Dann Berg's Daily Note Template for Obsidian. Uses Dataview & Templater plugins. Should be saved as a Markdown file in Obsidian. Read the full tour: https://dannb.org/blog/2022/obsidian-daily-note-template/
---
created: <% tp.file.creation_date() %>
---
tags:: [[+Daily Notes]]
# <% moment(tp.file.title,'YYYY-MM-DD').format("dddd, MMMM DD, YYYY") %>
<< [[Timestamps/<% tp.date.now("YYYY", -1) %>/<% tp.date.now("MM-MMMM", -1) %>/<% tp.date.now("YYYY-MM-DD-dddd", -1) %>|Yesterday]] | [[Timestamps/<% tp.date.now("YYYY", 1) %>/<% tp.date.now("MM-MMMM", 1) %>/<% tp.date.now("YYYY-MM-DD-dddd", 1) %>|Tomorrow]] >>
---
@jonlabelle
jonlabelle / npm_version_cheatsheet.md
Last active April 18, 2025 03:54
npm version cheatsheet

npm version cheatsheet

npm uses Semantic Versioning

npm uses Semantic Versioning. Given a version number MAJOR.MINOR.PATCH, increment the:

  1. MAJOR version when you make incompatible API changes,
  2. MINOR version when you add functionality in a backwards compatible manner, and
  3. PATCH version when you make backwards compatible bug fixes.
@sashadev-sky
sashadev-sky / 00_relative_import_resolution.py
Last active April 25, 2022 15:42
"ImportError: attempted relative import with no known parent package" and its sibling "ValueError: attempted relative import beyond top-level package"
print('__file__={0:<35} | __name__={1:<20} | __package__={2:<20}'.format(
__file__, __name__, str(__package__)))
@usametov
usametov / topics-search.txt
Created February 16, 2021 01:50
how to search github.com for multiple topics
Github.com ui .currently does not natively supoport search for multiple topic tags as of now. However their api allows you to query multiple tags. Below is a simple example to query github.com with ecs and go topic tags.
curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories?q=topic:ecs+topic:go
Response from the github can be rather verbose so lets filter only relavant info such repo url and description.
curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories\?q\=topic:ecs+topic:go | jq '.items[] | {url:.url, description:.description}'
@ivangeorgiev
ivangeorgiev / - SQL Server Snippets
Last active April 17, 2024 10:33
SQL Server Snippets
.
@mahammedzkhan
mahammedzkhan / zsh_aliases.sh
Last active February 15, 2022 10:03
Aliases
# software
alias cat="bat"
alias ls="exa"
alias pstorm="phpstorm"
alias ea="pstorm ~/.zsh_aliases"
# folders
alias pre="cd ~/Documents/Projects"
# git

Make a Bucket

Use the aws s3 mb command.

$ aws s3 mb s3://mycoolbucket --region eu-west-1
  make_bucket: mycoolbucket
@posilva
posilva / install.sh
Created November 13, 2019 11:45
Try Dax
#!/bin/bash
pip install amazon-dax-client
@alexcasalboni
alexcasalboni / index.py
Created October 21, 2019 13:47
AWS ALB - AWS Lambda handler (Python)
import json
def lambda_handler(event, context):
name = get_name(event) # extract inputs
message = get_message(name) # business logic
return build_response(message) # format output for ALB
def get_name(event):
# fetch inputs from event (could be missing)
return event['queryStringParameters'].get('name')
@gene1wood
gene1wood / new-python-project-with-tox-and-pytest.md
Last active January 17, 2023 05:07
Example of the directory structure, setup.py, tox.ini and pytest tests for a new python project

Directory structure

projectname/                 [1]
├── projectname              [2]
│   ├── __init__.py
├── README.md
├── setup.py
├── tests
│   └── test_projectname.py