Skip to content

Instantly share code, notes, and snippets.

View aravindballa's full-sized avatar
🌱
building stuff

Aravind Balla aravindballa

🌱
building stuff
View GitHub Profile
@Sh4yy
Sh4yy / clx.go
Created April 25, 2024 20:39
Generate CLI commands for common tasks.
package main
import (
"context"
"errors"
"fmt"
"io"
"log"
"os"
"runtime"
@alexanderisora
alexanderisora / finishJson5.ts
Created May 11, 2023 15:28
function to complete an unfinished JSON.
export const finishJson5 = (unfinishedJson5: string) => {
let stack = [];
let inDoubleQuotes = false;
let inSingleQuotes = false;
let inSingleLineComment = false;
for (let i = 0; i < unfinishedJson5.length; i++) {
const currentChar = unfinishedJson5[i];
const nextChar = unfinishedJson5[i + 1];
let prevChar;
@shabegom
shabegom / Tana QuickAdd.js
Last active July 5, 2023 23:33
Scriptable (iOS) Script for running a Tana QuickAdd Shortcut
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: green; icon-glyph: magic;
/*
SETUP INTSTRUCTIONS
0. Install the Tana QuickAdd Shortcut: https://www.icloud.com/shortcuts/74ce7f48d6d5493c8c0ba563c5f040d6
1. In Tana, Create a Node where you'd like quick added nodes to go.
- quick added nodes will appear as children of this one
- I put mine off my workspace root
@trungdq88
trungdq88 / paddle-revenue.js
Last active April 6, 2023 14:07
A scriptable's script to get Paddle revenue from multiple accounts using puppeteer.
/*
RUN THE SCRIPT BY YOURSELF:
- Run `node paddle-revenue.js` on your server and let it run 24/7.
- Access the API at http://your_server_ip:8175/ (JSON)
HOSTED VERSION:
If you don't want to run the script by your own, you can use the
hosted version. The price is $5 per month per Paddle account.
Here is how:
@linuz90
linuz90 / Plausible Live Stats.scriptable
Last active May 12, 2024 07:09
iOS widget to display a live visitors count with Plausible analytics and Scriptable.
// Configuration
// You'll be able to set the domain when adding/editing the widget
// Make sure the stats are public on Plausible
const namespace = args.widgetParameter || "plausible.io"
const displayName = namespace.slice(0,namespace.lastIndexOf("."))
const accentColor = new Color("#CCCCCC")
// LineChart by https://kevinkub.de/
// Used as the widget background
class LineChart {
@swyxio
swyxio / final submission.md
Last active April 22, 2023 19:17
Why React is Not Reactive - React Rally CFP

This is the CFP for my React Rally talk, which was eventually accepted and given here: https://www.youtube.com/watch?v=nyFHR0dDZo0.

If you are a first time speaker, my CFP advice for new speakers is here.

Final Submission: Why React is not Reactive

Functional-reactive libraries like RxJS make it easy to understand how data changes, giving us tools to declaratively handle events and manage state. But while our render methods react to state changes, React isn’t reactive. Instead, we write imperative event-handlers, and trip up on gotchas like async setState and race conditions. Why? In this talk we build a Reactive React to show the difference between the "push" and "pull" paradigms of data flow and understand why React chooses to manage Scheduling as a core Design Principle, enabling awesome features like async rendering and Suspense!

Theme: This talk is a deep dive into React's core design principle around scheduling. Instead of abstr

@victor-perez
victor-perez / git.bat
Last active August 4, 2021 14:16
Use WSL git inside VS Code from Windows 10 17046
@echo off
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
::this also support calls that contains a absolute windows path
::check of one of the params contain a absolute windows path
echo.%* | findstr /r /c:"[a-z]:[\\/]" > nul
if %errorlevel% == 1 (
::if not just git with the given parameters
call :git %*
@kitze
kitze / conditionalwrap.js
Created October 25, 2017 16:54
one-line React component for conditionally wrapping children
import React from 'react';
const ConditionalWrap = ({condition, wrap, children}) => condition ? wrap(children) : children;
const Header = ({shouldLinkToHome}) => (
<div>
<ConditionalWrap
condition={shouldLinkToHome}
wrap={children => <a href="/">{children}</a>}
>
@marc-rutkowski
marc-rutkowski / README.md
Last active June 17, 2021 13:17
react-storybook with react-boilerplate (content of the .storybook/ directory)

react-storybook with react-boilerplate

Explains how to install and configure react-storybook into a project created from the react-boilerplate setup.

Intro

React-boilerplate (rbp) is a good starting point to create React apps, with a focus on performance, best practices and DX.

The community around the repository is amazing and a constant source of learning.

@gokulkrishh
gokulkrishh / media-query.css
Last active May 17, 2024 04:45
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */