Integrates:
The code below displays a single paginated table with a simple filter.
Inspired by this article
# United States of America Python Dictionary to translate States, | |
# Districts & Territories to Two-Letter codes and vice versa. | |
# | |
# Canonical URL: https://gist.github.com/rogerallen/1583593 | |
# | |
# Dedicated to the public domain. To the extent possible under law, | |
# Roger Allen has waived all copyright and related or neighboring | |
# rights to this code. Data originally from Wikipedia at the url: | |
# https://en.wikipedia.org/wiki/ISO_3166-2:US | |
# |
#! /usr/bin/env python | |
''' | |
This is more of a personal reference as I use json very often. | |
The httplib2 examples are VERY good, and you should refer to them: | |
http://code.google.com/p/httplib2/wiki/Examples | |
''' | |
from httplib2 import Http | |
try: |
# | |
# Working with branches | |
# | |
# Get the current branch name (not so useful in itself, but used in | |
# other aliases) | |
branch-name = "!git rev-parse --abbrev-ref HEAD" | |
# Push the current branch to the remote "origin", and set it to track | |
# the upstream branch | |
publish = "!git push -u origin $(git branch-name)" |
import getYear from 'date-fns/get_year' | |
import getMonth from 'date-fns/get_month' | |
import addDays from 'date-fns/add_days' | |
import startOfWeek from 'date-fns/start_of_week' | |
const rows = range(6) | |
const cols = range(7) | |
/** | |
* Returns a two-dimensional array with calendar represented dates |
<# | |
.SYNOPSIS | |
This script installs Visual Studio Code Silently. | |
.DESCRIPTION | |
The script downloads the latest VSCode installer and performs a silent installation. | |
.NOTES | |
Run this script on a Windows Server instance. | |
#> |
import wagtail.admin.rich_text.editors.draftail.features as draftail_features | |
from wagtail.admin.rich_text.converters.html_to_contentstate import InlineStyleElementHandler | |
from wagtail.core import hooks | |
@hooks.register('register_rich_text_features') | |
def register_custom_style_feature(features): | |
feature_name = 'mycustomstyle' # .mycustomstyle will have to be defined in the CSS in order to get frontend styles working | |
type_ = feature_name.upper() | |
tag = 'span' |
.cm-green { | |
background-image: linear-gradient(30deg,#16d6d9,#96cc29); | |
} | |
.cm-blue { | |
background-image: linear-gradient(30deg,#009cf3,#16d6d9); | |
} | |
.cm-pink { | |
background-image: linear-gradient(30deg,#ff2277,#7a288c); |
Integrates:
The code below displays a single paginated table with a simple filter.
Inspired by this article
tmux, like other great software, is deceptive. On the one hand, it's fairly easy to get set up and start using right away. On the other hand, it's difficult to take advantage of tmux's adanced features without spending some quality alone time with the manual. But the problem with manuals is that they aren't geared toward beginners. They are geared toward helping seasoned developers and computer enthusiasts quickly obtain the
Alternative command to django loaddata when it is necessary to append fixture objects into an existing database. Instead of merging fixture data with your existing models (as it does loaddata) it appends all fixtures object by resetting all pk. M2M relations are managed at the end of the process, mapping the old primary keys with the new primary keys:
Example of test (appending data from Website2 into Website1):
# Website 1
python manage.py dumpdata app1 app2 ... > test_append_data_fixtures_pre.json
# Website 1
python manage.py dumpdata app1 app2 ... > fixture_to_import.json