This file contains hidden or 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 * as fs from 'fs'; | |
import { OpenAI } from 'openai'; | |
const openai = new OpenAI({ | |
apiKey: | |
process.env.OPENAI_API_KEY ?? | |
'', | |
}); | |
async function extractInfoFromImage(imagePath: string): Promise<any> { |
This file contains hidden or 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 axios from "axios"; | |
import fs from "fs"; | |
import sharp from "sharp"; | |
import text2png from "text2png"; | |
import { | |
getLatestVersion, | |
updateLatestVersion, | |
} from "../src/staticData/version"; | |
import { championImage, fetchChampions } from "../src/utils/champions"; |
This file contains hidden or 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
const kit = await getContractKit() | |
const dollar = await kit.contracts.getStableToken(StableToken.cUSD); | |
const rewardsTransfers = await dollar.getPastEvents('Transfer', { | |
fromBlock: '0', | |
toBlock: 'latest', | |
filter: { | |
// from is a list of all the rewards contract addresses | |
from: ['0x811d62024653F95219Cd011F9058f79aCDa2Af0f', '0x7dA1bBa5f1C146A1873035CEEe216411B7fCa379', '0xa84172A779798e9b75131595614b3130E8E13Dc5'], |
This file contains hidden or 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
[ | |
{ | |
"constant": true, | |
"inputs": [], | |
"name": "name", | |
"outputs": [{ "name": "", "type": "string" }], | |
"payable": false, | |
"stateMutability": "view", | |
"type": "function" | |
}, |
This file contains hidden or 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 React, { useEffect, useState, useRef } from 'react' | |
import { Animated, Easing } from 'react-native' | |
import PropTypes from 'prop-types' | |
const AnimatedNumber = ({ value, initialValue, animate, ...props }) => { | |
const [displayValue, setDisplayValue] = useState(initialValue) | |
const displayValueAnimation = useRef(new Animated.Value(initialValue)).current | |
useEffect(() => { | |
if (!animate) { |
This file contains hidden or 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
from xlrd import open_workbook | |
import re | |
import json | |
date_regex = re.compile('^[0-9][0-9]-[0-9][0-9]$') | |
new_page_regex = re.compile('^Página [0-9]+ de [0-9]+$') | |
def is_new_page(sheet, row, number_of_columns): | |
val = str(sheet.cell(row, 0).value) | |
if val.startswith('El importe adeudado'): |
This file contains hidden or 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
from flask import Flask, request | |
import os | |
from os.path import expanduser | |
app = Flask(__name__) | |
def expand(path): | |
if path.startswith('~'): | |
path = path[1:] | |
path = expanduser("~") + path |
This file contains hidden or 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
var opn = require('opn'); | |
const POSTFIX = 18 | |
var link = 'https://las.op.gg/multi/query=' | |
var total = 0 | |
var stdin = process.openStdin(); | |
stdin.addListener("data", function(d) { | |
var l = d.toString().trim() |
This file contains hidden or 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
public class FixedSwipeRefreshLayout extends SwipeRefreshLayout { | |
private boolean mHandleTouch = true; | |
public FixedSwipeRefreshLayout(Context context) { | |
super(context); | |
} | |
public FixedSwipeRefreshLayout(Context context, AttributeSet attrs) { |