Skip to content

Instantly share code, notes, and snippets.

View nielskrijger's full-sized avatar

Niels Krijger nielskrijger

View GitHub Profile
@maratori
maratori / .golangci.yml
Last active May 5, 2024 00:18
Golden config for golangci-lint
# This code is licensed under the terms of the MIT license https://opensource.org/license/mit
# Copyright (c) 2021 Marat Reymers
## Golden config for golangci-lint v1.58.0
#
# This is the best config for golangci-lint based on my experience and opinion.
# It is very strict, but not extremely strict.
# Feel free to adapt and change it for your needs.
run:
@lafiosca
lafiosca / persistMigration.ts
Last active February 13, 2024 03:42
redux-persist migrations in TypeScript with a little help from patch-package
import { createMigrate } from 'redux-persist';
import { RootState } from './modules/reducer';
/*
* Latest version (V3) is simply the currently used redux RootState.
*/
type PersistedRootStateV3 = RootState;
/*
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
export function withAppContext<
P extends { appContext?: AppContextInterface },
R = Omit<P, 'appContext'>
>(
Component: React.ComponentClass<P> | React.StatelessComponent<P>
): React.SFC<R> {
return function BoundComponent(props: R) {
return (
@andrewstuart
andrewstuart / .gitlab-ci.yml
Last active June 12, 2023 17:44
One Deployment Per branch, plus CI CD, gitlab and helm setup
image: docker.mydomain.com/build/kube-go-make
variables:
DOCKER_TAG: docker.mydomain.com/myapp/home:$CI_COMMIT_REF_SLUG
DOCKER_HOST: tcp://localhost:2375
DOCKER_DRIVER: overlay
PROD_RSYNC_HOST: myprodserver.com
DOMAIN: mydomain.com
CHART_DIR: chart
@nmerouze
nmerouze / main.go
Last active May 6, 2021 16:40
Example for "Build Your Own Web Framework in Go" articles
package main
import (
"database/sql"
"encoding/json"
"errors"
"fmt"
"log"
"net/http"
"time"
@soofaloofa-zz
soofaloofa-zz / On choosing a hypermedia type
Last active October 14, 2023 07:23
On choosing a hypermedia type for your API - HAL, JSON-LD, Collection+JSON, SIREN, Oh My!
A comparison of Collection+JSON, HAL, JSON-LD and SIREN media types.
Discussion at
http://sookocheff.com/posts/2014-03-11-on-choosing-a-hypermedia-format/
@gdusbabek
gdusbabek / node-cassandra-client-examples.js
Created April 12, 2012 17:31
Examples of how to use node-cassandra-client
var async = require('async');
function doSimpleConnect(callback) {
var Connection = require('cassandra-client').Connection;
// these are the connection parameters you need to connecto to Cassandra.
var connectionOptions = {
host: '127.0.0.1',
port: 19170,