Skip to content

Instantly share code, notes, and snippets.

View vetri02's full-sized avatar
🎯
Focusing

Vetrichelvan Jeyapalpandy vetri02

🎯
Focusing
View GitHub Profile
@joradn222
joradn222 / swap.py
Last active April 4, 2024 03:48
Swap on Osmosis in Python
from cosmospy import privkey_to_address, seed_to_privkey, Transaction
import requests
import json
import cosmospy_protobuf.osmosis.gamm.v1beta1.query_pb2 as query_pb
import cosmospy_protobuf.osmosis.gamm.v1beta1.query_pb2_grpc as query_pb_grpc
import cosmospy_protobuf.osmosis.gamm.v1beta1.tx_pb2 as tx_osmosis
from dotenv import dotenv_values
config = dotenv_values(".env")
seed = config['SEED']
const _ = require("lodash");
const BnbApiClient = require("@binance-chain/javascript-sdk");
const kava = require("@kava-labs/javascript-sdk");
const bnbCrypto = BnbApiClient.crypto;
const KavaClient = kava.KavaClient;
const kavaUtils = kava.utils;
const BINANCE_CHAIN_API_TESTNET = "https://testnet-dex.binance.org";
const BINANCE_CHAIN_DEPUTY = "tbnb1et8vmd0dgvswjnyaf73ez8ye0jehc8a7t7fljv";
const bnbAddress = "your binance chain testnet address";
@bendc
bendc / easing.css
Created September 23, 2016 04:12
Easing CSS variables
:root {
--ease-in-quad: cubic-bezier(.55, .085, .68, .53);
--ease-in-cubic: cubic-bezier(.550, .055, .675, .19);
--ease-in-quart: cubic-bezier(.895, .03, .685, .22);
--ease-in-quint: cubic-bezier(.755, .05, .855, .06);
--ease-in-expo: cubic-bezier(.95, .05, .795, .035);
--ease-in-circ: cubic-bezier(.6, .04, .98, .335);
--ease-out-quad: cubic-bezier(.25, .46, .45, .94);
--ease-out-cubic: cubic-bezier(.215, .61, .355, 1);
@danharper
danharper / BorderedInput.js
Last active May 16, 2016 20:31
BorderedInput, with Material design style focus animation. Preview: https://i.imgur.com/Fek7rXF.gif
// note there may be a better way to abuse flexbox than this :)
var React = require('react-native')
var { View, TextInput } = React
var BorderedInput = React.createClass({
getInitialState() {
return { i: 0 }
},
@desandro
desandro / require-js-discussion.md
Created January 31, 2013 20:26
Can you help me understand the benefit of require.js?

I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.

From Require.js - Why AMD:

The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"

I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.


@akgupta
akgupta / quotaexceeded.js
Created March 17, 2012 22:12
handle quota exceeded error in local storage
try {
module.$localStorage[key] = serializer(value);
} catch(e) {
if(e.name === 'QUOTA_EXCEEDED_ERR') {
// reset to make space
module.reset();
module.$localStorage[key] = serializer(value);
} else {
module.localStorageAvailable = false;
$log.error("Local storage write failure - " + e);