Skip to content

Instantly share code, notes, and snippets.

Avatar

Diego Fernández Bigomby

  • Morón de la Frontera, Spain
View GitHub Profile
@Bigomby
Bigomby / example.py
Last active Nov 22, 2019
Python blocking calls in async code
View example.py
import twitter
import asyncio
import time
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_TOKEN_KEY = ''
ACCESS_TOKEN_SECRET = ''
View functional.js
const fs = require('fs');
const DIRECTORY_COLOR = '\x1b[34m';
const FILE_COLOR = '\x1b[32m';
// -----------------------------------------------------------------------------
// Formatting
// -----------------------------------------------------------------------------
const buildPrefix = position => {
View example.js
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,
View example.js
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 +
View promises.js
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"];
View token.sol
pragma solidity ^0.4.20;
import "./ERC721Basic.sol";
import "./SafeMath.sol";
import "./Ownable.sol";
contract ColmenaToken is ERC721Basic, Ownable {
using SafeMath for uint256;
View bot.js
const Bot = require('./lib/Bot');
const SOFA = require('sofa-js');
const Fiat = require('./lib/Fiat');
// -----------------------------------------------------------------------------
// Globals
// -----------------------------------------------------------------------------
const bot = new Bot();
View gist:b4ba451a2f9bf9ee2307102fe99ee985
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 {
View erc20.sol
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);
View gist:c6d354d022f4a410cf1c59f48bc63b9d
### 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: