- A bit is a BInary digiT. It uses base 2.
- A byte is 8 bits.
- An IPv4 address is 4 bytes (32 bits) long. It is usually expressed in
decimal notation, i.e.
0-255.0-255.0-255.0-255
. - IP addresses comprise 2 parts:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Map Interface: {{{2 | |
if !hasmapto('<Plug>SaveWinPosn') | |
map <unique> <Leader>swp <Plug>SaveWinPosn | |
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python << EOF | |
import os | |
import sys | |
import vim | |
for p in sys.path: | |
if os.path.isdir(p): | |
vim.command(r"set path+=%s" % (p.replace(" ", r"\ "))) | |
EOF | |
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cleanup () { | |
find ./ -name '*~' -or -name '*.pyc' -or -name '#*#' -or -name '.*~' -or -name '.#*' | xargs rm -f | |
clear | |
} | |
# The previous cleanup function is potentially dangerous in an environment where you could have filenames with spaces. | |
# The safest pattern when using the find... xargs combo is to use null-terminators for filenames, i.e. | |
`find ... -print0 | xargs -0 ...`: | |
cleanup () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Store information about achievements # achievements.feature:1 | |
In order to manage achievements # achievements.feature:3 | |
As a programmer # achievements.feature:4 | |
I want to model them using the Django ORM # achievements.feature:5 | |
Scenario: Creating simple achievements # achievements.feature:7 | |
Given that I have the following achievement data: # achievement-steps.py:29 | |
| name | teaser | description | | |
| Bronze Star | The bronze award | This is the third rank | | |
| Silver Star | The silver award | This is the second rank | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db.models import ForeignKey | |
from django.contrib.auth.models import User | |
import threadlocals | |
class UserField(ForeignKey): | |
""" UserField | |
By defaults, foreign key to User; null=True, blank=True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
from south.modelsinspector import add_introspection_rules | |
except ImportError: | |
add_introspection_rules = False | |
if add_introspection_rules: | |
add_introspection_rules([ | |
( | |
[UserField], | |
[], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I need the best idiomatic way of getting a map of users and their points. | |
# The values/annotation combo *almost* gives me what I want, but doesn't return | |
# full user objects, only their ids. | |
>>> Points.objects.values('user').annotate(total_points=Sum('amount')) | |
[{'total_points': 40, 'user': 1}, {'total_points': 30, 'user': 2}] | |
# I've opted for something like this, instead: | |
Points.objects.users().annotate(total_points=Sum('points__amount')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a quick test of the gist-vim functionality. | |
More Booyah. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from 6c22c5f613adb15b9fe4d31ee70567d05cf127c8 mon sep 17 00:00:00 2001 | |
from: ahtn <ahtn@users.noreply.github.com> | |
Date: Sun, 18 Oct 2015 17:25:46 +1000 | |
Subject: [PATCH] Adds oneshot layer and oneshot tap toggling | |
* Adds ACTION_LAYER_ONESHOT | |
* Adds ONESHOT_TAP_TOGGLE | |
* Mentions sticky keys in the docs on oneshot. | |
--- | |
tmk_core/doc/keymap.md | 18 +- |
OlderNewer