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 requests | |
from lxml.html import fromstring | |
import os | |
search='https://www.youtube.com/results' | |
def make_my_day(query): | |
page = requests.get(search, params=[{'search_query', str(query)}]) | |
links = fromstring(page.text).cssselect('a') |
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 requests | |
import shutil | |
from lxml.html import fromstring | |
DPP='http://www.disneyphotopass.com' | |
html = fromstring(open('photopassinfos.html', 'r').read()) | |
imgs = html.cssselect('img') | |
for index, img in enumerate(imgs): | |
tmp = img.get('src').replace('=36', '=3096').replace('=70', '=300') + '&aspectRatio=EightByTen' |
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
(ns test-macro.utils) | |
(defn test-me [] | |
(str "Test me")) | |
(defn test-you [] | |
(str "Test you")) | |
(defn run-me [fn] | |
(eval (read-string (str "(test-macro.utils/test-" fn ")")))) |
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
(defonce color-map (range 255)) | |
(defn rand-color [max] | |
(nth color-map (rand-int max))) | |
(defn rainbownize [& text] | |
(->> (clojure.string/join #" " text) | |
seq | |
(map #(str "\033[38;5;" (rand-color 254) "m" % "\033[0m")) | |
(apply str))) |
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 requests | |
from lxml.html import fromstring | |
import os | |
kickass = "https://kickass.to/usearch/{0}/" | |
magnet=lambda link, local: os.system('aria2c --conf-path=$HOME/.aria2c.torrent --max-download-limit=1100K --max-upload-limit=15K --listen-port=63654 "' + link + '" -d '+ local +' --seed-time=1') | |
localFolder="~/Vídeos/Seriados/Gotham" |
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 requests | |
from lxml.html import fromstring | |
import os, sys | |
piratebay = "https://thepiratebay.se/search/{0}/0/99/0" | |
kickass = "https://kickass.to/usearch/{0}/" | |
magnet=lambda link, local: os.system('aria2c --conf-path=$HOME/.aria2c.torrent --max-download-limit=1100K --max-upload-limit=15K --listen-port=63654 "' + link + '" -d '+ local +' --seed-time=1') |
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
(ns mastermind.core | |
(:gen-class)) | |
(defn generate-numbers [] | |
(let [game [1 2 3 4 5 6]] | |
(->> game shuffle (take 4) vec))) | |
(defn guess [user answer] | |
(map #(= %1 %2) user answer)) |
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 urllib2, urllib, sys | |
from BeautifulSoup import BeautifulSoup | |
import re | |
class VisaVale(): | |
def get_visavale_informations(self,visa): | |
url = 'http://www.cbss.com.br/inst/convivencia/SaldoExtrato.jsp' | |
data = urllib.urlencode([('numeroCartao',visa),('primeiroAcesso','S')]) | |
request = urllib2.Request(url) |
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 sys | |
def prime(number): | |
n = abs(number) | |
if n < 1: | |
return False | |
if n==2: | |
return True |
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
;******************************************************************************************************************* | |
;Demonstrates the Goldbach's conjecture - Every even integer greater than 2 can be expressed as the sum of two primes | |
; | |
;Author: Igor Hercowitz | |
; | |
;usage: clisp goldbach.lisp <number> | |
;output: the sum of the primes list | |
; | |
;Ex: | |
;> clisp goldbach.lisp 100 |
OlderNewer