Run this one-liner in your project root to install or update the rule:
curl -s https://gist.githubusercontent.com/codekiln/242b572c64c1097277fd4c831db91c10/raw/update.sh | bash
--- | |
description: How to update markdown with fenced code blocks | |
globs: *.md, *.mdc | |
--- | |
- # Rules to follow when outputting markdown | |
If you nest fenced code blocks in markdown, it will break the rendering. It's important that there is only one level of triple-backtick fenced code blocks in markdown output. Place your response in a triple-backtick fenced codeblock that's labeled with markdown, and use triple tilde fenced codeblocks for any inner code blocks, as per the CommonMark spec. | |
<EXAMPLE> | |
```markdown | |
Here's an example of the code: | |
~~~ |
When collaborating with AI tools for code assistance, it's beneficial to provide them with an overview of your project's directory structure, excluding files specified in .gitignore
. This ensures that the AI has relevant context without being cluttered by unnecessary or ignored files. This gist sets up the ability to use git lsf
to list all relevant files and git lsfwd
to list files specific to the current working directory in a way that respects .gitignore
exclusions.
You can create a Git alias named lsf
to list all tracked and untracked files, excluding those ignored by Git. To set up this alias, execute the following command:
This script generates a Markdown-formatted link to the most recent Git commit in a repository, including the commit’s date/time, short SHA, and message. It’s designed for use as a Git alias but can also be run standalone.
YYYY-MM-DD HH:MM - shortSHA - commit message #git/commit
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key | |
# that enables you to choose a character from a menu of options. If you are on Lion | |
# try it by pressing and holding down 'e' in any app that uses the default NSTextField | |
# for input. | |
# | |
# It's a nice feature and continues the blending of Mac OS X and iOS features. However, | |
# it's a nightmare to deal with in Atom if you're running vim mode, | |
# as it means you cannot press and hold h/j/k/l to move through your file. You have | |
# to repeatedly press the keys to navigate. |
class ParentClass(object): | |
__special = '' | |
def __init__(self, *args, **kwargs): | |
self.__class__.__special = 'ParentClass' | |
self.__special = 'ParentClass' | |
print self.__dict__ | |
def special(self): |
from bs4 import BeautifulSoup | |
def get_text_from_html(html_str): | |
""" | |
Given a string of html, return the text content, | |
removing HTML contents and style artifacts. | |
This function solves an issue that when pasting from Word, | |
<style> tags can contain html comments that bsoup 4 | |
doesn't skip over when calling get_text(). |
# coding:utf-8 | |
import ctypes | |
import gc | |
import inspect | |
from collections import defaultdict | |
import re | |
from blinker import NamedSignal | |
from django.core.management.base import BaseCommand |
#!/usr/bin/env bash | |
# after running this command, the list of management commands will be in | |
# `sorted_management_commands.txt`, which you can `cat` out. | |
rm -f management_commands.txt | |
touch management_commands.txt | |
for i in **/management/commands/*.py | |
do echo "$(git log -1 --format='%ad | %C(green)%ae%Creset |' --date=short -- $i) $i" >> management_commands.txt | |
done | |
cat management_commands.txt | sort >! sorted_management_commands.txt |