Skip to content

Instantly share code, notes, and snippets.

View fyodorio's full-sized avatar
💻
Sitting here, making some stuff...

Fyodor fyodorio

💻
Sitting here, making some stuff...
View GitHub Profile

Preact, Without Build Tools

This is a demonstration of using Preact without any build tooling. The library is linked from the esm.sh CDN, however a standalone JS file exporting HTM + Preact + Hooks can also be downloaded here.

@NathanWalker
NathanWalker / http.interceptor.ts
Last active February 23, 2021 18:43
Simple offline handling with NativeScript using Angular as example
// pseudo code using angular flavor as example
@Injectable({ providedIn: 'root' })
export class SomeHttpInterceptor implements HttpInterceptor {
_mobileOffline = new MobileOffline();
constructor(private mobileStorage: MobileAPIStorageService) {}
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
if (!this._mobileOffline.isOnline) {
@twerske
twerske / Angular Slack theme
Last active January 14, 2021 09:21
Angular custom Slack theme
#1F1C18, #8E0E00, #C3002F, #FFFFFF, #3E403F, #FFFFFF, #DD0031, #DD0031, #C3002F, #FFFFFF
@Rich-Harris
Rich-Harris / what-is-svelte.md
Last active March 27, 2024 06:09
The truth about Svelte

I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.

But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.

Svelte is a language.

Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?

A few projects that have answered this question:

@samoshkin
samoshkin / postman_vs_insomnia_comparison.md
Created November 6, 2018 17:42
Comparison of API development environments: Postman vs Insomnia

Postman vs Insomnia comparison

Postman | API Development Environment https://www.getpostman.com
Insomnia REST Client - https://insomnia.rest/

Features                                        Insomnia Postman Notes
Create and send HTTP requests x x
Authorization header helpers x x Can create "Authorization" header for you for different authentication schemes: Basic, Digest, OAuth, Bearer Token, HAWK, AWS
@ThomasBurleson
ThomasBurleson / untilDestroyed.ts
Last active April 18, 2023 07:47
Using untilViewDestroyed to link component ngOnDestroy to observable unsubscribe.
/**
* When manually subscribing to an observable in a view component, developers are traditionally required
* to unsubscribe during ngOnDestroy. This utility method auto-configures and manages that relationship
* by watching the DOM with a MutationObserver and internally using the takeUntil RxJS operator.
*
* Angular 7 has stricter enforcements and throws errors with monkey-patching of view component life-cycle methods.
* Here is an updated version that uses MutationObserver to accomplish the same goal.
*
* @code
*
@LauLaman
LauLaman / gpg.md
Last active March 7, 2023 14:42
Use GPG to sign commits using git & PHPStorm

1 - install GPG tools : https://gpgtools.org/

2 - Create new key for your github email

3 - Add key to git on your local machine: git config --global user.signingkey YOURKEY

4 - configure git to sign all commits: git config --global commit.gpgsign true

5 - add to the bottom of ~/.gnupg/gpg.conf: (create the file if it not exists)

@PurpleBooth
PurpleBooth / README-Template.md
Last active June 21, 2024 17:56
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@leecardona
leecardona / RegEx for HTTP Status Codes
Created May 4, 2014 17:25
Javascript Regular Expression for valid HTTP Status Codes
//DEFINE REGEX - valid input range is 100 thru 599
var regEx = /^[1-5][0-9][0-9]$/
//TEST REGEX
regEx.test(99)
=>false
regEx.test(100)
=>true
@mattlewissf
mattlewissf / add-p.md
Last active June 14, 2024 06:08
Lightning Talk: Git add -p

git add -p is your friend

git add -p is basically "git add partial (or patch)"

Patch mode allows you to stage parts of a changed file, instead of the entire file. This allows you to make concise, well-crafted commits that make for an easier to read history. This feature can improve the quality of the commits. It also makes it easy to remove parts of the changes in a file that were only there for debugging purposes - prior to the commit without having to go back to the editor.

It allows you to see the changes (delta) to the code that you are trying to add, and lets you add them (or not) separately from each other using an interactive prompt. Here's how to use it:

from the command line, either use

  • git add -p