Skip to content

Instantly share code, notes, and snippets.

@jmoreno
jmoreno / smart_moments.py
Created July 21, 2016 20:56
smart_moments.py
import photos
import dialogs
all_moments = photos.get_moments()
titles = set()
for moment in all_moments:
if moment.title:
titles.add(moment.title)
sorted_titles = list(titles)
sorted_titles.sort()
@jmoreno
jmoreno / SongSearcherSpotify.py
Created April 12, 2016 00:29
SongSearcherSpotify.py
# coding: utf-8
import urllib
import urllib2
import json
track = raw_input('Título: ')
artist = raw_input('Artista: ')
def spotify(track, artist):
@jmoreno
jmoreno / Editorial-Medium-Workflow.py
Last active June 1, 2017 00:57
Python script that publish a post to Medium in draft status
import urllib2
import json
import workflow
import console
import keychain
params = workflow.get_parameters()
userAgent = 'Mozilla/5.0'
contentTypeHeader = 'application/json'
@jmoreno
jmoreno / gist:cd762004467f87b8e3a2
Created January 19, 2015 22:17
Dilbert script old
#coding: utf-8
import workflow
import editor
import console
# Get the custom parameters as a dictionary (titles are keys):
params = workflow.get_parameters()
# Get the action's input (a string):
action_in = workflow.get_input()
-007|STATEMENT CONTAINS THE ILLEGAL CHARACTER invalid-character
-010|THE STRING CONSTANT BEGINNING string IS NOT TERMINATED
-011|COMMENT NOT CLOSED
-029|INTO CLAUSE REQUIRED
-051|identifier-name (sql-type) WAS PREVIOUSLY DECLARED OR REFERENCED
-056|AN SQLSTATE OR SQLCODE VARIABLE DECLARATION IS IN A NESTED COMPOUND STATEMENT
-058|VALUE SPECIFIED ON RETURN STATEMENT MUST BE AN INTEGER
-060|INVALID specification-type SPECIFICATION : specification-value
-078|PARAMETER NAMES MUST BE SPECIFIED FOR ROUTINE routine-name
-079|QUALIFIER FOR OBJECT name WAS SPECIFIED AS qualifier1 but qualifier2 IS REQUIRED
Cad Bane;Bounty Hunter and Gunslinger;http://starwars.com/img/explore/encyclopedia/characters/cad bane_card.jpg;
Bossk;Trandoshan bounty hunter;http://starwars.com/img/explore/encyclopedia/characters/bossk_card.jpg;
Bulduga;Ithorian Bounty Hunter;http://starwars.com/img/explore/encyclopedia/characters/bulduga_card.jpg;
C-21 Highsinger;Mechanical Bounty Hunter;http://starwars.com/img/explore/encyclopedia/characters/c-21 highsinger_card.jpg;
Dengar;Bounty Hunter;http://starwars.com/img/explore/encyclopedia/characters/dengar_card.jpg;
Derrown;Parwan Bounty Hunter;http://starwars.com/img/explore/encyclopedia/characters/derrown_card.jpg;
Embo;Kyuzo bounty hunter;http://starwars.com/img/explore/encyclopedia/characters/embo_card.jpg;
Boba Fett;The Best Bounty Hunter in the Galaxy;http://starwars.com/img/explore/encyclopedia/characters/boba fett_card.jpg;
Jango Fett;Father of Boba Fett;http://starwars.com/img/explore/encyclopedia/characters/jango fett_card.jpg;
Garnac;Trandoshan Big Game Hunter...;http://starwars.com
@jmoreno
jmoreno / ZNOrigamiSegue.m
Created April 29, 2013 23:14
UIStoryboardSegue for Origami
//
// ZNOrigamiSegue.m
// mindcar
//
// Created by Javi on 17/04/13.
// Copyright (c) 2013 Zink In Apps!. All rights reserved.
//
#import "ZNOrigamiSegue.h"
@jmoreno
jmoreno / calendario.rb
Last active December 16, 2015 16:59
Script para desglosar el calendario de vacunaciones de las comunidades autonomas. El fichero de entrada será vacunas.csv obtenido de http://www.aepap.org/vacunas/calendarios-espanoles
$campos = ['Region', 'Fecha', 'RN', '1m', '2m', '4m', '6m', '12m', '15m', '18m', '2a', '3a', '4a', '6a', '10a', '11a', '12a', '13a', '14a', '16a']
$region = ""
$myfile = File.new("write.txt", "w+")
fichero = File.open('vacunas.csv', "r")
fichero.each { |file|
# file = file.encode('utf-8')
rowIn = file.split(';')
@jmoreno
jmoreno / Dealer Ergo Go
Last active December 15, 2015 20:29
Estructura para las pruebas de Helios.io
xml: http://www.google.com/reader/atom/feed/{escaped-url-feed}?n=1000
json: http://www.google.com/reader/api/0/stream/contents/feed/{escaped-url-feed}?n=1000
Campos del feed (0, no nos interesa de momento; 1, nos interesa ahora mismo):
0 direction
1 id
1 title
1 description
0 self []
0 href
# -*- coding:utf-8 -*-
"""
Backup Google Reader Items to WordPress eXtended RSS (Wordpress Export Format)
Download Feeds from http://www.google.com/reader/atom/feed/http://yourblogdomain.com/yourfeed?n=1000
(1000 = number of items)
Usage: reader2wordpress.py google_atom.xml http://yourblogdomain.com/
Licensed under BSD.