Skip to content

Instantly share code, notes, and snippets.

View clystian's full-sized avatar

Cristian Hernandez clystian

View GitHub Profile
@clystian
clystian / ReviewWithoutSizer.py
Created September 10, 2019 00:20
Review without Sizer, wxPython Widgets with absolute position
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import wx
class Example(wx.Frame):
def __init__(self, parent, title):
super(Example, self).__init__(parent, title=title)
import unirest
def convert_currency(origin, destination, amount = 1):
convert = origin+"_"+destination
urlRequest = "https://free.currconv.com/api/v7/convert?q="+convert+"&compact=ultra&apiKey=47353d3141893576b990"
response = unirest.get(urlRequest)
return amount * response.body[convert]
usdcop = convert_currency("USD","COP")
/* keep a reference to original toISOString to use it into new method */
const oldToISOString = Date.prototype.toISOString
/* Define new method */
const toISOString = function toISOString(date) {
if(!date) return date;
/* extract GTM timezone from date.toString() */
const regex = /(?:GMT)([-+]\d*)/gm;
let gtm = regex.exec(date.toString())[1];
gtm = [...gtm];
/* insert ':' in time -0500 -> -05:00*/
// Create a private scope.
(function( $, on ){
// I proxy the given function and return the resultant GUID
// value that jQuery has attached to the function.
var createAndReturnProxyID = function( target ){
// When generating the proxy, it doesn't matter what the
// "context" is (window in this case); we never actually
###
Module dependencies
###
require.paths.unshift "#{__dirname}/lib/support/express-csrf/"
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/"
express = require 'express'
app = module.exports = express.createServer()
RedisStore = require 'connect-redis'