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 difflib | |
import pygments | |
import pygments.lexers | |
import pygments.formatters | |
def read_file(fn): | |
with open(fn) as f: | |
return f.read() |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
{% block head %} | |
<title>{% block title %}Awesome website{% endblock %}</title> | |
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.css') }}"/> | |
{% endblock head %} | |
</head> | |
<body> | |
<header> |
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
def current_user(): | |
try: | |
return g.current_user | |
except RuntimeError: | |
return None | |
except AttributeError: | |
try: | |
g.current_user = db.query(User).get(session['user_id']) | |
except KeyError: | |
g.current_user = None |
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 collections import namedtuple, Counter | |
import urllib.request | |
Item = namedtuple('item', 'n l a b') | |
items = [] | |
for line in urllib.request.urlopen('http://blaxpirit.pythonanywhere.com/lyne/text'): | |
line = line.strip().decode('utf-8') | |
n, l, a, b = line.split() |
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
# Perhaps read this first: http://steamcommunity.com/app/266010/discussions/0/558750717604246010/ | |
from __future__ import print_function # Python 2 compatibility | |
from itertools import cycle | |
try: | |
from urllib.request import urlopen | |
except ImportError: | |
from urllib2 import urlopen # Python 2 compatibility | |
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 <iostream> | |
using namespace std; | |
struct Base { | |
void f() { | |
cout << "base" << endl; | |
} | |
void g() { | |
f(); |
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
#!/usr/bin/env python2 | |
import re | |
import unicodedata | |
import Skype4Py | |
emoticons = open('emoticons.txt').read().split() | |
emoticons_re = r'(' + '|'.join(re.escape(' '.join(e)).replace(' ', ' ?') for e in emoticons) + r')' |
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
git diff CSFML-2.1 CSFML-master | grep -vP '^([^-+]|. *//)' | sed -r 's/^[-+]{3} .+\///g' | uniq | |
Export.h | |
Listener.h | |
-CSFML_AUDIO_API void sfListener_setDirection(sfVector3f orientation); | |
+CSFML_AUDIO_API void sfListener_setDirection(sfVector3f direction); | |
+CSFML_AUDIO_API void sfListener_setUpVector(sfVector3f upVector); | |
+ | |
+CSFML_AUDIO_API sfVector3f sfListener_getUpVector(); | |
+ |
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 6ae230f9c9809141deea110900a36242ac9256dc Mon Sep 17 00:00:00 2001 | |
From: Oleh Prypin <[email protected]> | |
Date: Thu, 8 Jan 2015 00:09:07 +0200 | |
Subject: [PATCH] Add regex replacement using results of calling a procedure | |
--- | |
lib/impure/re.nim | 29 +++++++++++++++++++++++++++++ | |
1 file changed, 29 insertions(+) | |
diff --git a/lib/impure/re.nim b/lib/impure/re.nim |
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
var s = "abcdef" | |
echo s[2 .. -3] # I suggest to remove this | |
# cd | |
proc `^`(x: int): int = assert false | |
template ex{`[]`(s, `..`(a, `^`(b)))}(s: expr{noSideEffect}, a, b: int): expr = | |
s[a .. s.len+b] | |
echo s[2 .. ^ -3] # Easy fix in code |
OlderNewer