Skip to content

Instantly share code, notes, and snippets.

View thinklinux's full-sized avatar

Tihomir Valkanov thinklinux

  • Sofia, Bulgaria
View GitHub Profile
@dsumer
dsumer / paddle.interface.ts
Created May 18, 2022 11:13
TypeScript types for the Paddle Subscription webhook payloads
export interface PaddlePassthrough {
userId: string; // the id of the user in our supabase database
}
export enum PaddleSubscriptionStatus {
Active = 'active',
Trialing = 'trialing', // at the moment we don't support trial phases
PastDue = 'past_due', // Payment is pending, we should inform he user that he needs to update his payment method
Paused = 'paused', // at the moment we don't support pausing subscriptions
Cancelled = 'deleted',
@stowball
stowball / convert-svgs.js
Created October 24, 2017 09:40
A node script to convert a a folder of SVGs in to React Native SVGs for https://github.com/stowball/react-native-svg-icon
/*
Usage: npm run convert-svgs <type:icons|logos>
*/
/* eslint-disable no-console, no-shadow */
const exec = require('child_process').exec;
const fs = require('fs');
const type = process.argv[2] || 'icons';
const path = `./src/assets/svg/${type}`;
@sagivf
sagivf / RethinkDB count issue and solutions.md
Last active March 18, 2017 22:00
RethinkDB count issue and solutions
- Inexplicable perversity of human nature.
- The clever machinations of MongoDB's marketing people.
- The AGPL license killed it.
- We spent too long development before monetizing.
- Bad performance.
- Numeric types limited to a 64-bit `float`.
- Great product, but didn't/couldn't translate to revenue.
- Bad business model.
- Failure in timezones/timestamp nuances.
@Rich-Harris
Rich-Harris / footgun.md
Last active April 19, 2024 07:47
Top-level `await` is a footgun

Edit — February 2019

This gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:

  • TC39 is currently moving forward with a slightly different version of TLA, referred to as 'variant B', in which a module with TLA doesn't block sibling execution. This vastly reduces the danger of parallelizable work happening in serial and thereby delaying startup, which was the concern that motivated me to write this gist
  • In the wild, we're seeing (async main(){...}()) as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problems
  • Therefore, a version of TLA that solves the original issue is a valuable addition to the language, and I'm in full support of the current proposal, which you can read here.

I'll leave the rest of this document unedited, for archaeological

@markerikson
markerikson / dispatching-action-creators.js
Last active May 2, 2020 14:27
Dispatching action creators comparison
// approach 1: define action object in the component
this.props.dispatch({
type : "EDIT_ITEM_ATTRIBUTES",
payload : {
item : {itemID, itemType},
newAttributes : newValue,
}
});
// approach 2: use an action creator function
@Jpoliachik
Jpoliachik / index.ios.js
Last active August 17, 2021 10:27
ReactNative LayoutAnimation Example
'use strict';
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View,
TouchableOpacity,
LayoutAnimation,
} from 'react-native';
@gokulkrishh
gokulkrishh / media-query.css
Last active April 26, 2024 10:32
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@DavidWells
DavidWells / reset.css
Last active April 11, 2024 19:03 — forked from karbassi/reset.css
CSS reset. Follow me on the twitters for more tips: https://twitter.com/davidwells
/* http://meyerweb.com/eric/tools/css/reset/
v2.0-modified | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,