Skip to content

Instantly share code, notes, and snippets.

View Bigomby's full-sized avatar

Diego Fernández Bigomby

  • Morón de la Frontera, Spain
View GitHub Profile
@Bigomby
Bigomby / example.py
Last active November 22, 2019 13:34
Python blocking calls in async code
import twitter
import asyncio
import time
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_TOKEN_KEY = ''
ACCESS_TOKEN_SECRET = ''
const fs = require('fs');
const DIRECTORY_COLOR = '\x1b[34m';
const FILE_COLOR = '\x1b[32m';
// -----------------------------------------------------------------------------
// Formatting
// -----------------------------------------------------------------------------
const buildPrefix = position => {
const orderItemListPromises = orderItemList.map(orderItems => {
return Promise.all(
orderItems.data.map(async orderItem => {
const filter = { where: { orderId: orderItem.order_id } };
const dateString = orderItem.date + "";
const stadistics = {
shopId: orderItem.shopId,
date: parseInt(dateString.slice(0, -3)),
itemName: orderItem.item_name,
amount: orderItem.total,
const orderItemListPromises = orderItemList.map(orderItems =>
Promise.all(
orderItems.map(orderItem => {
let filter = { where: { orderId: orderItem.order_id } };
myStadistic.shopId = orderItem.shopId;
listStatsToSave.push(myStadistic);
return axios.get(
url +
const axios = require("axios");
const APP_ID = "b360564f62c547d1ac191557181610";
function buildUrl(city) {
return `https://api.worldweatheronline.com/premium/v1/weather.ashx?key=${APP_ID}&q=${city}&format=json`;
}
function getCurrentConditions(response) {
return response.data.data["current_condition"];
pragma solidity ^0.4.20;
import "./ERC721Basic.sol";
import "./SafeMath.sol";
import "./Ownable.sol";
contract ColmenaToken is ERC721Basic, Ownable {
using SafeMath for uint256;
const Bot = require('./lib/Bot');
const SOFA = require('sofa-js');
const Fiat = require('./lib/Fiat');
// -----------------------------------------------------------------------------
// Globals
// -----------------------------------------------------------------------------
const bot = new Bot();
import { Wallet, Chat, Identity } from './';
import { RequestSigner } from './request-signer';
import { MemorySignalStore } from './signal-account/stores/memory-signal-store';
import { SignalAccount } from './signal-account';
const chatUrl = 'https://chat.development.service.toshi.org';
const identityUrl = 'https://identity.development.service.toshi.org';
function createMessage(destinationRegistrationId: number, destination: string) {
return {
pragma solidity ^0.4.20;
import "./ERC20Basic.sol";
contract BasicToken is ERC20Basic {
// Evento que se ejecuta cuando se realiza una compra. Se emite en el evento
// la dirección de quien ha comprado tokens y la cantidad.
event Buy(address buyer, uint256 amount);
### Keybase proof
I hereby claim:
* I am bigomby on github.
* I am bigomby (https://keybase.io/bigomby) on keybase.
* I have a public key ASBFlH7pkEYz5R5T4n02Um1RhIMlpODw7WhoCmQ-8W6Tnwo
To claim this, I am signing this object: