This file contains hidden or 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 hidden or 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 hidden or 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 set(variable, value, varmap): | |
varmap[variable]=int(value) | |
def get(variable, varmap): | |
try: | |
ret=varmap[variable] | |
except: | |
ret="NULL" | |
print(ret) |
This file contains hidden or 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
(require '[ring.util.codec :as codec]) | |
(defn compress [t] | |
(let [bout (java.io.ByteArrayOutputStream.) | |
out (java.uil.zip.GZIPOutputStream. bout)] | |
(clojure.java.io/copy t out) | |
(.close out) | |
(.toByteArray bout))) | |
This file contains hidden or 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
(defun set-clojure-mode () | |
(interactive) | |
(save-excursion | |
(split-window-horizontally) | |
(clojure-mode) | |
(cider-jack-in) | |
(other-window 0))) | |
(global-set-key (kbd "C-z") 'undo) |
This file contains hidden or 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
(defprotocol Hello (say [x])) | |
(extend-protocol Hello | |
String (say [x] (str "Hello String " x)) | |
Long (say [x] (str "Hello Number " x))) | |
;usage | |
(say "World") ;expected: "Hello String World" | |
(say 42) ;expected: "Hello Number 42" |
This file contains hidden or 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 | |
magnet=lambda x: os.system('aria2c --conf-path=$HOME/.aria2c.torrent --max-download-limit=1200K --max-upload-limit=15K --listen-port=63654 "' + x + '" -d ~/Vídeos/Seriados/Greys_Anatomy/ --seed-time=1') | |
for ep in range(2, 25): | |
if ep < 10: | |
ep = "0"+str(ep) | |
page = requests.get("http://kickass.to/usearch/greys%20anatomy%20s09e"+str(ep)).text | |
magep = fromstring(page).cssselect("a.imagnet")[0].get("href") |
This file contains hidden or 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 java.sql.*; | |
public class SqliteSample { | |
Connection conn = null; | |
boolean inserting = false; | |
public SqliteSample() { | |
} |
This file contains hidden or 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
(defmulti action (fn [x] [(x :func) (x :speed)])) | |
(defmethod action [:run :fast] [x] (str "Running fast")) | |
(defmethod action [:run :slow] [x] (str "Running slow")) | |
(defmethod action :default [x] (str "Dont know what to do")) |
This file contains hidden or 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> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/> | |
<script src="http://cmx.io/v/0.1/cmx.js"></script> | |
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style> | |
<body> | |
<div style="max-width:900px; -webkit-transform:rotate(0deg);"> | |
<scene id="scene1"> | |
<label t="translate(0,346)"> |