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
from time import sleep | |
from datetime import datetime | |
from binance.client import Client | |
from binance.helpers import date_to_milliseconds, interval_to_milliseconds | |
SECONDS_IN_MINUTE = 60 | |
def _sample_crude_api_limiting(headers, threshold=1190, delay_buffer=5, weight_updates=False, sleep_updates=True, force_sleep=False): | |
if headers: |
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
<? | |
# MIT license, do whatever you want with it | |
# | |
# This is my invoice.php page which I use to make invoices that customers want, | |
# with their address on it and which are easily printable. I love Stripe but | |
# their invoices and receipts were too wild for my customers on Remote OK | |
# | |
require_once(__DIR__.'/../vendor/autoload.php'); |
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
export default function createCrudHooks({ | |
baseKey, | |
indexFn, | |
singleFn, | |
createFn, | |
updateFn, | |
deleteFn, | |
}) { | |
const useIndex = (config) => useQuery([baseKey], indexFn, config) | |
const useSingle = (id, config) => |
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 { useEffect, useState } from 'react'; | |
import * as Font from 'expo-font'; | |
import { SplashScreen } from 'expo'; | |
/** | |
* Load and use resources that need to be loaded async by Expo SDK | |
*/ | |
const useExpoResources = () => { | |
const [isLoading, setIsLoading] = useState(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
# download this file to your project folder and excute | |
# chmod +x generate-ios.sh | |
# then run using | |
# ./generate-ios.sh | |
# flutter build defaults to --release | |
flutter build ios --no-codesign | |
# make folder, add .app then zip it and rename it to .ipa | |
mkdir -p Payload |
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
pragma solidity >=0.4.22 <0.6.0; | |
contract ERC20 { | |
// Balances | |
mapping(address => uint) tokenBalances; | |
// Allowances | |
mapping(address => mapping(address => uint)) tokenAllowances; | |
// The owner of this token | |
address public owner; |
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 React, { useState } from "react"; | |
import LoginComponent from "./LoginComponent"; | |
const usersTest = Array(8) | |
.fill({ name: "", cns: "" }) | |
.map((_, index) => ({ | |
name: `User ${index}`, | |
cns: `123.456.${index}`, | |
})); |
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
# download this file to your project folder and excute | |
# chmod +x generate-ios.sh | |
# then run using | |
# ./generate-ios.sh | |
# flutter build defaults to --release | |
flutter build ios | |
# make folder, add .app then zip it and rename it to .ipa | |
mkdir -p Payload |
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
function adb_connect { | |
# PORT used to connect. Default: 5555 | |
PORT=${1:-5555} | |
# IP address from current device connected | |
IP_ADDRESS=`adb shell ip route | awk '{print $9}'` | |
echo "ADB connect to $IP_ADDRESS on port $PORT" | |
# Change connection from usb to tcpip using $PORT |
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 { useEffect, useRef } from 'react'; | |
import { useHistory } from 'react-router-dom'; | |
export const usePrompt = (when: boolean, message: string = 'Are you sure you want to quit without saving your changes?') => { | |
const history = useHistory(); | |
const self = useRef(null); | |
const onWindowOrTabClose = event => { | |
if (!when) { |
NewerOlder