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 Mapping | |
from twisted.names import dns, server, client, cache | |
from twisted.application import service, internet | |
class MapResolver(client.Resolver): | |
def __init__(self, mapping, servers): | |
client.Resolver.__init__(self, servers=servers) |
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
;; turn line numbers off by default | |
(global-linum-mode -1) | |
(defun goto-line-with-feedback (&optional line) | |
"Show line numbers temporarily, while prompting for the line number input" | |
(interactive "P") | |
(if line | |
(goto-line line) | |
(unwind-protect | |
(progn |
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
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
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/python3 | |
import json | |
import urllib.parse | |
import urllib.request | |
def showsome (searchfor): | |
query = urllib.parse.urlencode ({'q': searchfor}) | |
print (query) | |
url = 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&' + query |