Skip to content

Instantly share code, notes, and snippets.

View luckylooke's full-sized avatar

Ctibor Laky luckylooke

View GitHub Profile
@MattSPalmer
MattSPalmer / on-subscribe.js
Last active May 11, 2020 04:43
debug subscriptions
const onSubscribe = (fn) => stream => Rx.defer(() => {
fn();
return stream;
})
const logOnSubscribe = message => onSubscribe(() => console.log(message));
Rx.interval(10e3).pipe(
switchMap(() => interval(200).pipe(
logOnSubscribe('subscribed to 200ms interval')
@cowboy
cowboy / mock-axios.js
Last active April 14, 2024 05:40
axios mocking via interceptors
import axios from 'axios'
let mockingEnabled = false
const mocks = {}
export function addMock(url, data) {
mocks[url] = data
}
@jbutko
jbutko / express-ionic-nginx.md
Last active June 2, 2017 06:06
Serve ExpressJS API together with Angular/Ionic static site: Nginx config
  1. create new file: sudo nano /etc/nginx/sites-available/mysite.com.conf and add:
server {            
        # on which port should nginx listen
        listen 80 default_server;                                                                                                     
        listen [::]:80 default_server;                                                                                                
                                        
        # serve client
        root /home/ionic-app/client/www;                                                                               
        index index.html index.htm;
@discordier
discordier / gist:ed4b9cba14652e7212f5
Created December 4, 2014 06:23
options for phpStorm @noinspection annotation
javascript
ES6ValidationInspection
JSAccessibilityCheckInspection
JSBitwiseOperatorUsageInspection
JSCheckFunctionSignaturesInspection
JSClosureCompilerSyntaxInspection
JSCommentMatchesSignatureInspection
JSComparisonWithNaNInspection
JSConsecutiveCommasInArrayLiteralInspection
@jiripudil
jiripudil / spinner.html
Created August 17, 2013 17:32
Pure JavaScript spinner
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Pure JS spinner</title>
<style>
#spinner { font-size: 6em; }
</style>