Skip to content

Instantly share code, notes, and snippets.

View webeli's full-sized avatar
🎯
Focusing

web3li webeli

🎯
Focusing
View GitHub Profile
@jfloss1
jfloss1 / jfloss1.marketcap.cash.js
Created September 10, 2021 16:21
Tampermonkey Script for MarketCap.Cash
// ==UserScript==
// @name MarketCap.Cash Unofficial Features
// @namespace https://github.com/jfloss1
// @version 1
// @description Add wallet connection support + token balance and totals
// @author John Floss
// @match https://www.marketcap.cash/
// @icon https://www.google.com/s2/favicons?domain=marketcap.cash
// @require https://cdn.ethers.io/lib/ethers-5.2.umd.min.js
// @grant none
@muralikg
muralikg / background.js
Last active July 29, 2024 14:29
puppeteer screen capture demo. Currently records 10 second video. Change the timeout in background.js with your own logic to stop the recording when necessary. Try with `node export.js`
/* global chrome, MediaRecorder, FileReader */
chrome.runtime.onConnect.addListener(port => {
let recorder = null
port.onMessage.addListener(msg => {
console.log(msg);
switch (msg.type) {
case 'REC_STOP':
console.log('Stopping recording')
if (!port.recorderPlaying || !recorder) {
@geoffreydhuyvetters
geoffreydhuyvetters / react_fiber.md
Last active August 15, 2024 15:17
What is React Fiber? And how can I try it out today?
anonymous
anonymous / auth.py
Created July 31, 2016 14:11
Just use it and don't think of it.
def connect(email, password):
'''
Atrocious function to connect to Pokémon Go with a Google account.
I have no shame.
Returns the identification token on success, 'None' otherwise.
'''
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP
@beaucharman
beaucharman / throttle.js
Last active November 12, 2022 15:39
An ES6 implementation of the throttle function. "Throttling enforces a maximum number of times a function can be called over time. As in 'execute this function at most once every 100 milliseconds.'" - CSS-Tricks (https://css-tricks.com/the-difference-between-throttling-and-debouncing/)
function throttle(callback, wait, immediate = false) {
let timeout = null
let initialCall = true
return function() {
const callNow = immediate && initialCall
const next = () => {
callback.apply(this, arguments)
timeout = null
}
anonymous
anonymous / index.html
Created February 9, 2016 08:22
React Example rlgame2 new: add, display, remove items // source http://jsbin.com/mihumom
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="rlgame2 new: add, display, remove items">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="https://cdn.firebase.com/js/client/2.4.0/firebase.js"></script>
<script src="https://cdn.firebase.com/libs/reactfire/0.5.1/reactfire.min.js"></script>
<script src="http://fb.me/react-with-addons-0.14.3.js"></script>
<script src="http://fb.me/react-dom-0.14.3.js"></script>
anonymous
anonymous / index.html
Created February 9, 2016 08:19
React Example Logbook of Exercices // source http://jsbin.com/mehive
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Logbook of Exercices">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="https://cdn.firebase.com/js/client/2.4.0/firebase.js"></script>
<script src="https://cdn.firebase.com/libs/reactfire/0.5.1/reactfire.min.js"></script>
<script src="http://fb.me/react-with-addons-0.14.3.js"></script>
<script src="http://fb.me/react-dom-0.14.3.js"></script>
anonymous
anonymous / index.html
Created February 2, 2016 16:31
React Example React Firebase Add and Display Items // source http://jsbin.com/gajugi
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="React Firebase Add and Display Items">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="https://cdn.firebase.com/js/client/2.4.0/firebase.js"></script>
<script src="https://cdn.firebase.com/libs/reactfire/0.5.1/reactfire.min.js"></script>
<script src="http://fb.me/react-with-addons-0.14.3.js"></script>
<script src="http://fb.me/react-dom-0.14.3.js"></script>
@chantastic
chantastic / on-jsx.markdown
Last active November 10, 2024 13:39
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

<script type='text/javascript' src='astar.js'></script>
<script type='text/javascript'>
var graph = new Graph([
[1,1,1,1],
[0,1,1,0],
[0,0,1,1]
]);
var start = graph.grid[0][0];
var end = graph.grid[1][2];
var result = astar.search(graph, start, end);