h,j,k,l — move left, down, up, right
{,} — go to previous/next paragraph (where the previous/next blank line is}
% — go to matching brace/parens
gg — start of file
G — end of file
z. — to put the line with the cursor at the center,
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 python | |
import re | |
def is_nice(s): | |
return (len(re.findall(r"[aeiou]", s)) >= 3 and | |
bool(re.search(r"(\w)\1+", s)) and not | |
bool(re.search(r"ab|cd|pq|xy", s))) | |
if __name__ == "__main__": | |
with open('input1.txt', 'r') as 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
def fibonacci(n): | |
if n == 0: | |
print "finobacci(0) = 0" | |
return 0 | |
elif n == 1: | |
print "finobacci(1) = 1" | |
return 1 | |
else: | |
print "fibonacci(%s) = fibonacci(%s) + fibonacci(%s)" % (n, n-1, n-2) | |
return fibonacci(n-1) + fibonacci(n-2) |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: unicorn-daemon | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Put a short description of the service here | |
# Description: Put a long description of the service here |
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 itertools | |
import re | |
import pygame | |
import sys | |
import colorsys | |
import numpy as np | |
WHITE = ( 255, 255, 255) | |
if __name__ == '__main__': |
NewerOlder