Instantly share code, notes, and snippets.
probably coding
Interested in Bitcoin, Holochain and Radix. Contributor to DeXter. Co-Founder of Rakoon.fun.
dcts /gist:25918788037d1bc4112ea2e992aff478
CreatedApril 16, 2024 22:16
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
// 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(); |
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
// 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 /gist:432a6cbada6ca2a153edac435e6327f7
CreatedOctober 26, 2023 12:26 — forked fromcollinprice/gist:9541470
Base64 encoded audio file. 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 sound = new Audio("data:audio/wav;base64,UklGRuy3AABXQVZFZm10IBAAAAABAAEAIlYAACJWAAABAAgAZGF0Yci3AACIhISCgH5+enx+gHx4cm5udHp+fHh0cHJ0enx8enx+fn6GiIyMiIaKio6Wmp6goJycnp6coJ6cnJqanqSoqqigmJKSmJygop6ampycmpaOjIiIhoSChoiGgHx2cG5qaGhiYmRkZmRgXFpUUlJUVlhcVlZYWmBgYFxaWlxiZmpsbGxsampubnBwbmxsbnB0cHBubGpqbGxwcnRwbnB2enyAfoB8fH5+goSEhISCgICEhoyKhoCChIiMjIyKiIaCgoaMioiEhISGjpaanJyYlpSWnqKkoJyYlpiYmJaSkI6MioSKjIyIhIB8en5+fHp2eHp6fn6AfHp8enh8foSEgoJ+foKGiIaAeHR2dn58fHx8fHZ2cnBydnRwcHJ6fHp2dHBwbm5sbm5wcHJubnB0dHBwbG50dnx8enp4enZ2dnZ0dnh4fH5+fHp2dHR0enZ0cnZ6eHp6eHh0dnh0dHZ2eHZ0cGxqamZiXFpYWFhaWlhYVlhYVlZaWl5gYGJkZmhoaGxucHJ0eHR2en58fHh0dnZ8foCAgH6ChoSEhISEhoaIjJKWmpiSkpSWmp6enJiampqcnpqYkI6MjIyOjIiGhoiIhoqIiISChISKjo6MiISEhoqOkJKSkpSQjpKYmpqWkJCOkpKUkpKQio6OjI6MhoKAenp2dHJuamhoZGRoamhmZmZkZmhqamhoaGxsbm5qamZoaGpqbm5ubmxuamxsbm50cnR2fHx+foSAfn6CiIqMjpKSkpaeoqCWlJSWlpSanp6alJSSkJCSlpaSkpKWmqCemJKOjI6SlpaYnJqUlJaYlpKQkJCSlpqYkI6OjoyKiIiEgHx+hoaIhoJ8dHBucnR0cHJycHJucGpoZmZoZGZoaG5ubmpsamhkZGRkZGZqbGhmZmhkZGZkYmJkZGZqbG5wcGh |
dcts /gist:940fbd0c23d6ffd1de621707ec041fdf
CreatedOctober 6, 2023 12:59 — forked fromrxaviers/gist:7360908
Complete list of github markdown emoji markupdcts /codeTranslate.js
Last activeFebruary 23, 2023 01:48
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
// 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 |
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
console.log("hi from gist.github.com/dcts"); |
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
// 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 /scrape_opensea_floor_prices.py
CreatedOctober 24, 2021 21:10
Scrape opensea floor prices with python cloudscraper package 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
importcloudscraper | |
importjson | |
deffilter_typename(dict): | |
returndict["__typename"]=="AssetQuantityType" | |
deffilter_quantityInEth_exists(dict): | |
if"quantityInEth"indict: | |
returnTrue | |
else: |
dcts /gist:76c74cbecdcae3e3aec15e40ad7c101b
Last activeMarch 6, 2021 08:43
gridjs get Grid instance to change data programatically 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{Grid}from'gridjs-react'; | |
import{useRef}from"react"; | |
constMyComponent=()=>{ | |
constgridRef=useRef(); | |
constchangeMyGrid=()=>{ | |
constgridjsInstance=gridRef.current.getInstance(); | |
// update col names | |
gridjsInstance.updateConfig({ |
dcts /fanboy-cookiemonster.txt
CreatedJanuary 9, 2021 20:34
copied fromhttps://github.com/easylist/easylist 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
[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