GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.
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
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
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
INCDIR = $(HOME)/opt/local/include/luajit-2.0 | |
LIBDIR = $(HOME)/opt/local/lib | |
LIB = -lluajit-51 | |
all: native | |
native: | |
cc --std=c99 -o native-co native.c -I$(INCDIR) -L$(LIBDIR) $(LIB) -pagezero_size 10000 -image_base 100000000 | |
clean: |
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
import pygtk | |
pygtk.require("2.0") | |
import gobject | |
import gtk | |
from gtk import gdk | |
class EntryMultiCompletion(gtk.Entry): | |
def __init__(self): | |
gtk.Entry.__init__(self) |
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
#include <gtk/gtk.h> | |
enum | |
{ | |
COLUMN_ARTICLE = 0, | |
COLUMN_PRICE, | |
N_COLUMNS | |
}; | |
typedef struct |
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
# | |
# 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)" |
To remove a submodule you need to:
- Delete the relevant section from the .gitmodules file.
- Stage the .gitmodules changes git add .gitmodules
- Delete the relevant section from .git/config.
- Run git rm --cached path_to_submodule (no trailing slash).
- Run rm -rf .git/modules/path_to_submodule (no trailing slash).
- Commit git commit -m "Removed submodule "
- Delete the now untracked submodule files rm -rf path_to_submodule
A list of interesting GH repos:
- https://github.com/vim-scripts/rest.vim (rest.vim from 2004, "derived somewhat from Nikolai Weibull's" syntax file)
- https://github.com/mitsuhiko/vim-rst (syntax, based on Nikolai Weibull's rst syntax, no documentation)
- https://github.com/mrsipan/vim-rst (mappings, folding, syntax based on Nikolai Weibull's rst syntax, no documentation)
- https://github.com/khorser/vim-rst-ftplugin (no syntax, ftplugin for folding, mappings for navigation, modification)
- https://github.com/veselosky/vim-rst (a ftplugin that sets nolist and a snippets file with one snippet)
- https://github.com/edthedev/rst-syntax.vim (sets filetype=rst for *.txt)
- https://github.com/yang-ling/rst/blob/master/ftplugin/rst.vim (a ftplugin that sets indent options)
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
# -*- coding: utf-8 -*- | |
import asyncio | |
import re | |
import asyncio_redis | |
import tornado.concurrent | |
import tornado.httpclient | |
import tornado.web | |
import tornado.platform.asyncio |
I changed this!
This is an HTML5 audio player that detects the user agent of your device/browser/OS and applies styling that matches the native audio player. The playlist responds to the width of your screen and features basic UI controls.
Feel free to fork this pen and add your own user agent styles for different browsers, devices and operating systems.
OlderNewer