This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Calendar from "~components/Calendar" | |
import { useEffect, useRef, useState } from "react" | |
import cssTextFcDaygrid from "data-text:@fullcalendar/daygrid/main.css" | |
import cssTextFcCommon from "data-text:@fullcalendar/common/main.css" | |
import cssTextFcTimegrid from "data-text:@fullcalendar/timegrid/main.css" | |
import cssTextGlobals from "data-text:~styles/globals.css" | |
import { | |
ChakraProvider, | |
Modal, | |
ModalBody, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// colors from materialui.co/socialcolors | |
module.exports = { | |
theme: { | |
colors: { | |
'facebook': '#3b5999', | |
'messenger': '#0084ff', | |
'twitter': '#55acee', | |
'linkedin': '#0077b5', | |
'skype': '#00aff0', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const WebSocketProxy = new Proxy(window.WebSocket, { | |
construct(target, args) { | |
console.log("Proxying WebSocket connection", ...args); | |
const ws = new target(...args); | |
// Configurable hooks | |
ws.hooks = { | |
beforeSend: () => null, | |
beforeReceive: () => null | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Http; | |
namespace HttpContext_RemoteIPAddress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
master: | |
image: mongo | |
links: | |
- slave | |
networks: | |
- mongo-cluster | |
volumes: | |
- ./init-repl-set.sh:/docker-entrypoint-initdb.d/init-repl-set.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies: | |
pre: | |
- curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg | |
- sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg | |
- sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list' | |
- sudo apt-get update | |
- sudo apt-get install dotnet-sdk-2.0.2 | |
override: | |
- dotnet restore | |
test: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const bs = require('browser-sync').create(); | |
const componentPath = `/components/${__dirname.split('/').pop()}`; | |
bs.init({ | |
files: [ '**/*.{html,js,css}' ], | |
open: false, | |
ghostMode: false, | |
startPath: `${componentPath}/demo/index.html`, | |
serveStatic: [{ | |
route: componentPath, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usually I use this in my app's config file, in case I need to disable all cache from the app | |
// Cache is from `js-cache`, something like `import Cache from 'js-cache';` | |
const cacheable = true, | |
cache = new Cache(); | |
// On request, return the cached version, if any | |
axios.interceptors.request.use(request => { | |
// Only cache GET requests | |
if (request.method === 'get' && cacheable) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Action, ActionReducer, Store } from '@ngrx/store'; | |
import { BehaviorSubject } from 'rxjs/BehaviorSubject'; | |
import { Observable } from 'rxjs/Observable'; | |
import { map } from 'rxjs/operator/map'; | |
import { Observer } from 'rxjs/Observer'; | |
// TODO: How to initialize those variables? | |
const dispatcherMock: Observer<Action>, | |
reducerMock: Observer<ActionReducer<any>>, | |
stateMock: Observable<any>; |
NewerOlder