Skip to content

Instantly share code, notes, and snippets.

View ndelitski's full-sized avatar

Nick Delitski ndelitski

  • Lisbon, Portugal
  • 10:15 (UTC -12:00)
View GitHub Profile
@ndelitski
ndelitski / redis-no-persistence.conf
Created July 20, 2016 09:10
redis without persistence config
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
# 1gb => 1024*1024*1024 bytes
#
@ndelitski
ndelitski / netcat.sh
Last active October 14, 2020 09:09
measure network speed with netcat
# on server machine
nc -v -v -l -n -p 2222 >/dev/null
# on client machine. transfer 2GB
dd if=/dev/zero bs=2100004096 count=1 | nc 172.30.1.171 2222
/* eslint-disable global-require */
import path from 'path'
import Server from '@frankmoney/webapp/es/server/Server'
import config from '../../config'
import initRoutes from './router'
const isProd = process.env.NODE_ENV === 'production'
const findUser = ({ graphqlClient }) =>
graphqlClient(`{
me {
/* eslint-disable global-require */
import express from 'express'
import compression from 'compression'
import favicon from 'serve-favicon'
import bodyParser from 'body-parser'
import cookieParser from 'cookie-parser'
import helmet from 'helmet'
import csrf from 'csurf'
import apiProxyMiddleware from './middlewares/apiProxyMiddleware'
import authenticate from './middlewares/authenticate'
import { matchRoutes } from 'react-router-config'
import { flatMap, values } from 'lodash'
import { createMemoryHistory } from 'history'
import { wrapRootEpic } from 'react-redux-epic'
import createStore from 'app/createStore'
import { featureTypes } from 'client/checkFeature'
import renderHtmlPage from './renderHtml'
import { normalizeAssets, orderAssets, normalizeStore } from './utils'
import renderRoute from './renderRoute'
import React from 'react'
import { renderToString } from 'react-redux-epic'
import { JssProvider, SheetsRegistry } from 'react-jss'
import { Provider as StoreProvider } from 'react-redux'
import Helmet from 'react-helmet'
import { GridSystemProvider } from '@frankmoney/grid'
import StaticReduxRouter from 'app/components/routing/StaticReduxRouter'
import GraphqlProvider from 'app/components/GraphqlProvider'
import ThemeProvider from 'app/components/ThemeProvider'
import HttpClientProvider from 'app/components/HttpClientProvider'
@ndelitski
ndelitski / 1.yml
Created November 30, 2015 15:03
drone.yml examples
clone:
path: github.com/gogits/gogs
build:
image: golang:$$GO_VERSION
environment:
- TAGS="pam sqlite"
- BUILD_OS="windows linux darwin freebsd openbsd netbsd"
@ndelitski
ndelitski / vm.swift
Created September 28, 2016 13:09
RX+MVVM.swift
import Foundation
import RxSwift
import GoogleSignIn
import RxViewModel
import RxCocoa
import RealmSwift
class InboxDetailViewModel: RxViewModel {
// Input
struct Input {
const LogRecordList = records =>
<div>
{records.map((record, idx) => renderRecord(record, idx, records))}
</div>
// utils
const lensEq = R.curryN(3, (lens, val, data) =>
R.pipe(R.view(lens), R.equals(val))(data)
)
const lensNotEq = R.complement(lensEq)
const createCase = (inProps, outProps) => () => {
const initialProps = merge({
hasFoundationRole: false,
status: SECTION_STATUS.needClarification,
finished: true,
permissions: [
SECTION_PERMISSION.readStatus,
SECTION_PERMISSION.sendClarification,
],
}, inProps)