Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Search Gists
Sign in Sign up

Instantly share code, notes, and snippets.

View dcts's full-sized avatar
💭
probably coding

dcts dcts

💭
probably coding
Interested in Bitcoin, Holochain and Radix. Contributor to DeXter. Co-Founder of Rakoon.fun.
View GitHub Profile
// Helper function to download data
function downloadObjectAsJson(exportObj: any, exportName: string) {
var dataStr =
"data:text/json;charset=utf-8," +
encodeURIComponent(JSON.stringify(exportObj, null, 2));
var downloadAnchorNode = document.createElement("a");
downloadAnchorNode.setAttribute("href", dataStr);
downloadAnchorNode.setAttribute("download", exportName + ".json");
document.body.appendChild(downloadAnchorNode); // required for firefox
downloadAnchorNode.click();
@dcts
dcts /gist:e92ad3302be703707592761426854dec
CreatedApril 12, 2024 17:52
getTokenInfos.ts for DeXter
// Helper function to download data
function downloadObjectAsJson(exportObj: any, exportName: string) {
var dataStr =
"data:text/json;charset=utf-8," +
encodeURIComponent(JSON.stringify(exportObj, null, 2));
var downloadAnchorNode = document.createElement("a");
downloadAnchorNode.setAttribute("href", dataStr);
downloadAnchorNode.setAttribute("download", exportName + ".json");
document.body.appendChild(downloadAnchorNode); // required for firefox
downloadAnchorNode.click();
@dcts
dcts /gist:432a6cbada6ca2a153edac435e6327f7
CreatedOctober 26, 2023 12:26— forked fromcollinprice/gist:9541470
Base64 encoded audio file.
var sound = new Audio("data:audio/wav;base64,UklGRuy3AABXQVZFZm10IBAAAAABAAEAIlYAACJWAAABAAgAZGF0Yci3AACIhISCgH5+enx+gHx4cm5udHp+fHh0cHJ0enx8enx+fn6GiIyMiIaKio6Wmp6goJycnp6coJ6cnJqanqSoqqigmJKSmJygop6ampycmpaOjIiIhoSChoiGgHx2cG5qaGhiYmRkZmRgXFpUUlJUVlhcVlZYWmBgYFxaWlxiZmpsbGxsampubnBwbmxsbnB0cHBubGpqbGxwcnRwbnB2enyAfoB8fH5+goSEhISCgICEhoyKhoCChIiMjIyKiIaCgoaMioiEhISGjpaanJyYlpSWnqKkoJyYlpiYmJaSkI6MioSKjIyIhIB8en5+fHp2eHp6fn6AfHp8enh8foSEgoJ+foKGiIaAeHR2dn58fHx8fHZ2cnBydnRwcHJ6fHp2dHBwbm5sbm5wcHJubnB0dHBwbG50dnx8enp4enZ2dnZ0dnh4fH5+fHp2dHR0enZ0cnZ6eHp6eHh0dnh0dHZ2eHZ0cGxqamZiXFpYWFhaWlhYVlhYVlZaWl5gYGJkZmhoaGxucHJ0eHR2en58fHh0dnZ8foCAgH6ChoSEhISEhoaIjJKWmpiSkpSWmp6enJiampqcnpqYkI6MjIyOjIiGhoiIhoqIiISChISKjo6MiISEhoqOkJKSkpSQjpKYmpqWkJCOkpKUkpKQio6OjI6MhoKAenp2dHJuamhoZGRoamhmZmZkZmhqamhoaGxsbm5qamZoaGpqbm5ubmxuamxsbm50cnR2fHx+foSAfn6CiIqMjpKSkpaeoqCWlJSWlpSanp6alJSSkJCSlpaSkpKWmqCemJKOjI6SlpaYnJqUlJaYlpKQkJCSlpqYkI6OjoyKiIiEgHx+hoaIhoJ8dHBucnR0cHJycHJucGpoZmZoZGZoaG5ubmpsamhkZGRkZGZqbGhmZmhkZGZkYmJkZGZqbG5wcGh
@dcts
dcts /codeTranslate.js
Last activeFebruary 23, 2023 01:48
// HELPER FUNCTIONS
functionsetLoading(bool){
constbttn=document.querySelector(".experimentalEngeduGtiProjectsWeek20230206EmeaTeam03JavaComGoogleBoqCodetransUiHomeHomeViewTranslateBttn_");
constbttnText=document.querySelector(".experimentalEngeduGtiProjectsWeek20230206EmeaTeam03JavaComGoogleBoqCodetransUiHomeHomeViewTranslateBttnText_");
constbttnTextSpanLoader=document.querySelector(".experimentalEngeduGtiProjectsWeek20230206EmeaTeam03JavaComGoogleBoqCodetransUiHomeHomeViewTranslateBttnTextSpanLoader_");
if(bool){// set loading state
bttn.classList.add("isLoading_");
bttnText.classList.add("isLoading_");
bttnTextSpanLoader.classList.add("isLoading_");
}else{// unset loading state
@dcts
dcts /test.js
CreatedFebruary 22, 2023 18:04
console.log("hi from gist.github.com/dcts");
@dcts
dcts /download_object_as_json.js
Last activeDecember 9, 2022 11:54
download_object_as_json.js
// taken from here => https://stackoverflow.com/a/30800715/6272061
functiondownloadObjectAsJson(exportObj,exportName){
vardataStr="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(exportObj,null,2));
vardownloadAnchorNode=document.createElement('a');
downloadAnchorNode.setAttribute("href",dataStr);
downloadAnchorNode.setAttribute("download",exportName+".json");
document.body.appendChild(downloadAnchorNode);// required for firefox
downloadAnchorNode.click();
downloadAnchorNode.remove();
}
@dcts
dcts /scrape_opensea_floor_prices.py
CreatedOctober 24, 2021 21:10
Scrape opensea floor prices with python cloudscraper package
importcloudscraper
importjson
deffilter_typename(dict):
returndict["__typename"]=="AssetQuantityType"
deffilter_quantityInEth_exists(dict):
if"quantityInEth"indict:
returnTrue
else:
@dcts
dcts /gist:76c74cbecdcae3e3aec15e40ad7c101b
Last activeMarch 6, 2021 08:43
gridjs get Grid instance to change data programatically
import{Grid}from'gridjs-react';
import{useRef}from"react";
constMyComponent=()=>{
constgridRef=useRef();
constchangeMyGrid=()=>{
constgridjsInstance=gridRef.current.getInstance();
// update col names
gridjsInstance.updateConfig({
[Adblock Plus 2.0]
! Checksum: OTa5p+sF/XAuky8K97XxEw
! Title: Easylist Cookie List
! Updated: 9 Jan 2021
! Expires: 4 days (update frequency)
! License: http://creativecommons.org/licenses/by/3.0/
! Please report any unblocked content or problems by email or in our forums
! Email: easylist.subscription@gmail.com
! Homepage: https://easylist.to/
! Forums: https://forums.lanik.us/
NewerOlder

[8]ページ先頭

©2009-2025 Movatter.jp