Skip to content

Instantly share code, notes, and snippets.

View zoek1's full-sized avatar
🏠
Working from home

Miguel Angel Gordián zoek1

🏠
Working from home
View GitHub Profile
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)
@zoek1
zoek1 / goto-line-with-feedback.el
Created August 8, 2012 10:06 — forked from magnars/goto-line-with-feedback.el
Emacs: Show line numbers temporarily, while prompting for the line number input
;; 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
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
@zoek1
zoek1 / googlesearch.py
Created June 27, 2012 12:51
@CodeJobs GoogleSearch #Python3
#!/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