1.) Download a Nerd Font
2.) Unzip and copy to ~/.fonts
3.) Run the command fc-cache -fv
to manually rebuild the font cache
# fzf improvement to preview content from files | |
function fzf-lovely(){ | |
fzf -m --preview '[[ $(file --mime {}) =~ binary ]] && | |
echo {} is a binary file || | |
(bat --style=numbers --color=always {} || | |
highlight -O ansi -l {} || | |
coderay {} || | |
rougify {} || | |
cat {}) 2> /dev/null | head -500' | |
} |
<?php | |
/** | |
* Escape markdown text | |
* | |
* @param string $text the markdown text to escape | |
* | |
* @return string escaped text | |
*/ | |
function markdown_escape($text) { | |
return str_replace([ |
{% extends "base.html" %} | |
{% block content %} | |
<form method="post">{% csrf_token %} | |
{{ forms.subscription }} | |
<input type="submit" value="Subscribe"> | |
</form> | |
<form method="post">{% csrf_token %} | |
{{ forms.contact }} | |
<input type="submit" value="Send"> |
1.) Download a Nerd Font
2.) Unzip and copy to ~/.fonts
3.) Run the command fc-cache -fv
to manually rebuild the font cache
#!/bin/sh | |
sc () { | |
if [ $COLOR = "bar" ] ; then | |
case $2 in | |
bold) case $1 in | |
black) echo "%{F#FF000000}";; | |
red) echo "%{F#FFFF0000}";; | |
green) echo "%{F#FF00FF00}";; | |
yellow) echo "%{F#FFFF4500}";; |
import sqlite3 | |
# open connection and get a cursor | |
conn = sqlite3.connect(':memory:') | |
c = conn.cursor() | |
# create schema for a new table | |
c.execute('CREATE TABLE IF NOT EXISTS sometable (name, age INTEGER)') | |
conn.commit() |
1) Create a branch with the tag | |
git branch {tagname}-branch {tagname} | |
git checkout {tagname}-branch | |
2) Include the fix manually if it's just a change .... | |
git add . | |
git ci -m "Fix included" | |
or cherry-pick the commit, whatever is easier | |
git cherry-pick {num_commit} | |
#-*- coding: utf-8 -*- | |
import urlparse | |
from django.contrib.auth import REDIRECT_FIELD_NAME, login | |
from django.contrib.auth.forms import AuthenticationForm | |
from django.http import HttpResponseRedirect | |
from django.utils.decorators import method_decorator | |
from django.views.decorators.cache import never_cache | |
from django.views.decorators.csrf import csrf_protect | |
from django.views.generic.edit import FormView | |
from django.conf import settings |