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
def paridad_dolar_dof(dia, mes, year ): | |
""" funcion python para extraer tipo de cambio del colar | |
segun el Diario Oficial de la Federacion | |
Autor : @jdaguilera | |
""" | |
from BeautifulSoup import BeautifulSoup | |
from urllib2 import urlopen | |
url = "http://dof.gob.mx/indicadores_detalle.php?cod_tipo_indicador=158&dfecha={0:02d}%2F{1:02d}%2F{2}&hfecha={0:02d}%2F{1:02d}%2F{2}".format( dia, mes, year) | |
contents = urlopen(url).read() | |
soup = BeautifulSoup( contents ) |
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 paramiko | |
k = paramiko.RSAKey.from_private_key_file("/Users/whatever/Downloads/mykey.pem") | |
c = paramiko.SSHClient() | |
c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) | |
print "connecting" | |
c.connect( hostname = "www.acme.com", username = "ubuntu", pkey = k ) | |
print "connected" | |
commands = [ "/home/ubuntu/firstscript.sh", "/home/ubuntu/secondscript.sh" ] | |
for command in commands: | |
print "Executing {}".format( command ) |
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 os, sys, subprocess | |
from mako.template import Template | |
from mako.runtime import Context | |
from cStringIO import StringIO #needed as buffer for mako | |
try: | |
from mako.util import FastEncodingBuffer #new kind of buffer that is faster ( version 0.4) than StringIO | |
except: | |
pass | |
from ho import pisa as pisa |
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
defmodule Color do | |
@moduledoc false | |
def color_reset , do: "\x1b[0m" | |
def color_red, do: "\x1b[31m" | |
def color_green, do: "\x1b[32m" | |
def color_yellow, do: "\x1b[33m" | |
@doc """ | |
function to add color to string to be used in console apps. |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
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 Ember from 'ember'; | |
let { computed, get, set } = Ember; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
value: '945', | |
style: 'color: black', | |
valor: computed('value', { | |
get(){ | |
let valor = `&#${get(this,'value')}` ; | |
return valor.htmlSafe();} |
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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
isGlimmerComponent: 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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
isGlimmerComponent: 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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
isGlimmerComponent: true | |
}); |
NewerOlder