profile
viewpoint

humaans/figbird 32

Effortless realtime data management for React + Feathers applications

iislucas/isaplib 8

Isabelle/IsaPlanner SML Library (for PolyML)

KidkArolis/cherrytree-for-react 5

Seamlessly use cherrytree router with React

KidkArolis/cherrytree-redux-react-example 3

A copy of emmenko/redux-react-router-async-example where react-router is replaced with cherrytree

KidkArolis/amd-utils 1

modular JavaScript utilities written in the AMD format

KidkArolis/backbone-bindings 1

Bi-directional bindings between Backbone.View elements and Backbone.Model attributes.

KidkArolis/bro-size 1

Estimate the size of a package by browserifying it, uglifying and gzipping.

KidkArolis/deploy 1

Tweaked combo of tj/deploy and mafintosh/taco-nginx

KidkArolis/abyssa-js 0

Stateful, hierarchical router for single page applications

KidkArolis/aloe 0

npm in the browser

issue commentfeathersjs/schema

RFC - a place to discuss and refine the API

value -> write resolve -> read

Everything async might be slower for validation purposes.. (especially per field).

Fastify uses json schemas: https://www.fastify.io/docs/latest/Validation-and-Serialization/, and its swappable with other libs. Although I haven't used fastify / explored enough to comment further. I just had a lot of success with ajv in my own app. It did sometimes feel like “I didn’t enjoy” using it, things like conditional logic was tricky, sometimes i moved parts of validation to a hook. But overall a lot of it made sense, and created consistency.

On Tue, 7 Jul 2020 at 09:39, David Luecke notifications@github.com wrote:

Maybe value and resolve is not super aptly named (set and get doesn't really fit though either) but the user schema is a good example for unifying things that currently have to be done with (imo clunky) hashPassword and protect hooks:

const UserSchema = schema({ name: 'user'}, { email: { type: string() }, password: { type: string(), value: async password => { // Hash the password before saving to the database return bcrypt(password); }, resolve: async (password, user, context) { // Never return the actual value for external requests if (context.params.provider) { return undefined; }

  return password;
}

}});

This also allows assembling queries with more complex conditions in one place possible:

const MessageQuerySchema = schema({ name: 'message-query'}, { userId: { type: string(), value: async (userId, query, context) => { const { user } = context.params;

  // Non admins can only query their own messages
  return user.isAdmin ? userId : user.id;
}

},

private: { type: boolean(), value: async (private, query, context) => { const { user } = context.params;

  // Free plan members can never query private messages
  return user.plan === 'free' ? false : private;
}

}});

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/feathersjs/schema/issues/20#issuecomment-654693976, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACPGWB4VLADNKPOIBYN5MLR2LNMFANCNFSM4MMSPTCA .

DesignByOnyx

comment created time in a day

created taghumaans/next-img

tagv0.3.1

A Next.js plugin for embedding optimized images.

created time in 3 days

push eventhumaans/next-img

Karolis Narkevicius

commit sha 1e9f398aff0adafe345ba4053048b9c747f1f70f

0.3.1

view details

push time in 3 days

push eventhumaans/next-img

Karolis Narkevicius

commit sha 39c6476ebe8d77eeeb0d6a8ded800a467d5f4cd1

Fix boolean query option parsing

view details

push time in 3 days

startedremirror/remirror

started time in 8 days

issue commentpinojs/pino

Guidance needed on adding dynamic context - mixin / formatters / serializers

@jsumners when would you say child logger bindings should be used then if ever?

KidkArolis

comment created time in 12 days

issue commentpinojs/pino

Guidance needed on adding dynamic context - mixin / formatters / serializers

So apart from the formatter ~bug, would you say formatters is the best way to add dynamic context to log messages - if so - should mixin be removed altogether as it seems to be superseded by formatters?

KidkArolis

comment created time in 12 days

issue commentpinojs/pino

Guidance needed on adding dynamic context - mixin / formatters / serializers

However, you also have a mistake in your example. You are not providing anything for the logger to serialize.

I am passing context in the child creation:

image

KidkArolis

comment created time in 12 days

issue commentpinojs/pino

Guidance needed on adding dynamic context - mixin / formatters / serializers

That's a great example to build upon! In your example, you're adding the user to the context by passing it into the log call. So the next question (my original question, in fact) would be - how do you inject the user into the logger's context such that individual log calls don't have to manually pass the user in.

I tried to reproduce each of the scenarios above with that use case in mind and show why neither works (except the last scenario sort of works):

Mixin

Issue: mixin is never called and therefore user is never logged.

const pino = require('pino')

const logger = pino()

const context = {}

const child = logger.child({
  mixin() {
    console.log('Calling mixin?')
    return { user: context.user }
  }
})

child.info('Logging before user is available')
context.user = { id: 1 }
child.info('Logging after user is available')

// Output: no user provided

// {"level":30,"time":1593173891224,"pid":7109,"hostname":"inrainbows.local","msg":"Logging before user is available"}
// {"level":30,"time":1593173891224,"pid":7109,"hostname":"inrainbows.local","msg":"Logging after user is available"}

Serializer

Issue: serializer is cached and therefore user is never logged.

const pino = require('pino')

const logger = pino()

const context = {}

const child = logger.child({
  context,
  serializers: {
    context: (context) => {
      console.log('Calling serializer?')
      return { user: context.user }
    }
  }
})

child.info('Logging before user is available')
context.user = { id: 1 }
child.info('Logging after user is available')

// Output: no user provided
// 
// Calling serializer?
// {"level":30,"time":1593174010110,"pid":7129,"hostname":"inrainbows.local","context":{},"msg":"Logging before user is available"}
// {"level":30,"time":1593174010111,"pid":7129,"hostname":"inrainbows.local","context":{},"msg":"Logging after user is available"}

Formatter

Ok, this works!

However, if you turn on "prettyPrint: true" when creating pino (which we use in development), the code below throws on this line. Which means it's not possible for a formatter to "rewrite" the message on the fly in such a way, which admittedly can be avoided by not deleting the object in the first place. But I'm not sure how to "reason" about this? This is the issue flagged in #866.

obj.responseHeaders = obj.res.headers
                                    ^

TypeError: Cannot read property 'headers' of undefined
const pino = require('pino')

const logger = pino()

const context = {}

const child = logger.child({
  context,
  formatters: {
    log: (obj) => {
      obj.user = context.user
      obj.responseHeaders = obj.res.headers
      delete obj.res
      return obj
    }
  }
})

child.info({ res: { headers: 'x' } }, 'Logging before user is available')
context.user = { id: 1 }
child.info({ res: { headers: 'x' } }, 'Logging after user is available')

// Output: no user provided
// 
// Calling serializer?
// {"level":30,"time":1593174188579,"pid":7160,"hostname":"inrainbows.local","context":{},"responseHeaders":"x","msg":"Logging before user is available"}
// {"level":30,"time":1593174188580,"pid":7160,"hostname":"inrainbows.local","context":{},"user":{"id":1},"responseHeaders":"x","msg":"Logging after user is available"}
KidkArolis

comment created time in 12 days

issue commentpinojs/pino

Log formatter getting called twice - intentional?

I've looked a bit more into it, it's only happening when pretty printing is enabled, e.g.:

const pino = require('pino')

const logger = pino({
  prettyPrint: true
})

const child = logger.child({
  formatters: {
    log(obj) {
      console.log('Formatting log', obj)
      obj.replacement = obj.missing
      delete obj.missing
      return obj
    }
  }
})

child.info({ missing: 'a', works: 'hello' }, 'Only logging once')

Outputs:

Formatting log { missing: 'a', works: 'hello' }
Formatting log { works: 'hello', replacement: 'a', msg: 'Only logging once' }
[1593173703575] INFO  (7085 on inrainbows.local): Only logging once
    works: "hello"

Notice that:

  1. We log once, but formatting happens twice
  2. Notice that the final log output has neither missing nor replacement key (!?)
KidkArolis

comment created time in 12 days

issue openedpinojs/pino

Guidance needed on adding dynamic context - mixin / formatters / serializers

Hi.. first of all, love pino, been a very helpful solid library so far.

However, I keep coming back to trying to find the best way to add dynamic context into log messages at log time (e.g. current user, and some other meta data).

More concretely, if I have a set of middleware processing a request, the request might get gradually extended, e.g.:

  1. request is made
  2. request id is generated
  3. user is authenticated
  4. some params are calculated

If I log something after each of those steps, I want to log as much context as is already available, e.g. if user is present on req.user - log it, otherwise don't. That kind of thing (I donno, maybe this is bad design?).

And it seems like there's no clear way of doing this, I tried the following.

Mixin

This doesn't work - the mixin is never called on child loggers (?).

function createRequestLogger(context) {
  return context.app.get('logger').child({
    mixin() {
      return calculateDynamicMetaFromContext(context)
    }
  })
}

Serializers

This doesn't work - the result of the serializer is cached and is incorrect upon later logs.

function createRequestLogger(context) {
  return context.app.get('logger').child({
    context,
    serializers: {
      context: calculateDynamicMetaFromContext
    }
  })
}

Formatters

This kind of works - but formatter is being called twice during a log call (See #866) and can yield incorrect results if the formatter removes something from the provided object, because the 2nd time it's called that extra meta is now been deleted.

function createRequestLogger(context) {
  return context.app.get('logger').child({
    formatters: {
      log: calculateDynamicMetaFromContext(context)
    }
  })
}

In other words - I don't know why there are 3 ways to do something very similar yet all ways are strangely confusing with their own quirks 🤷‍♂️

created time in 12 days

issue openedpinojs/pino

Log formatter getting called twice - intentional?

Hi! Trying to understand if it's intentional that the formatter.log gets called twice:

https://github.com/pinojs/pino/blob/faf7cb85fe645cfec08a12b46ea0dc21c0f77f11/lib/proto.js#L160-L171

  • first time via line 160
  • second time via line 171

I'm mutating the object being logged (should I not be?) and it's causing some unexpected output.

created time in 13 days

push eventhumaans/next-img

Karolis Narkevicius

commit sha bea1d1690ef8460834b7367f0a3ff4236395152b

Updates

view details

push time in 20 days

created taghumaans/next-img

tagv0.3.0

A Next.js plugin for embedding optimized images.

created time in 20 days

push eventhumaans/next-img

Karolis Narkevicius

commit sha bfdb91dc73f7111bb2982e528319ff32f88a0d35

0.3.0

view details

push time in 20 days

push eventhumaans/next-img

Karolis Narkevicius

commit sha 04843dc3d350e1057c5dee64cb3d2441d9769f66

Provide width/height to img tag to hint browser layout calc

view details

push time in 20 days

issue openedhumaans/next-img

Move config into an internal object instead of piggy backing on next config

This is to avoid triggering the experimental feature warning:

image

created time in 23 days

delete branch KidkArolis/awesome-nextjs

delete branch : patch-1

delete time in 23 days

PR opened unicodeveloper/awesome-nextjs

Add next-img plugin
+1 -0

0 comment

1 changed file

pr created time in 23 days

push eventKidkArolis/awesome-nextjs

Karolis Narkevicius

commit sha 98afd4166b6a8df4ad04991b845ef11b7f4b90a1

Add next-img plugin

view details

push time in 23 days

fork KidkArolis/awesome-nextjs

:notebook_with_decorative_cover: :books: A curated list of awesome resources : books, videos, articles about using Next.js (A minimalistic framework for universal server-rendered React applications)

fork in 23 days

PR opened vercel/next-plugins

Add next-img
+1 -0

0 comment

1 changed file

pr created time in a month

create barnchKidkArolis/next-plugins

branch : add-next-img

created branch time in a month

fork KidkArolis/next-plugins

Official Next.js plugins

fork in a month

issue commentvercel/next.js

Feature request- Built-in image component

I have been working on something to solve this for myself that might be of interest: https://github.com/humaans/next-img/. I agree, this is a fairly complicated area when developing sites with Next.js, I hope next-img can be of use to others or provide feedback to a potential native Next.js implementation.

Vadorequest

comment created time in a month

issue commentcyrilwanner/next-optimized-images

Image optimisation not working with Next 9.1

I have since developed and starting using my own solution to embedding images in Next.js projects, in case anyone here finds it useful: https://github.com/humaans/next-img/

KidkArolis

comment created time in a month

push eventhumaans/next-img

Karolis Narkevicius

commit sha 4460491f3e02e77901bf80864df1e37086f485c1

0.2.0

view details

push time in a month

created taghumaans/next-img

tagv0.2.0

A Next.js plugin for embedding optimized images.

created time in a month

push eventhumaans/next-img

Karolis Narkevicius

commit sha 33f51407e2a222cdb6100b973d0063818b54ccb2

Fix healthier complaining about docs output

view details

push time in a month

push eventhumaans/next-img

Karolis Narkevicius

commit sha 9cb600e601d9a03d24f3e6f17764943df96decef

Fix docs release script

view details

Karolis Narkevicius

commit sha 81bc34914af4b5db50ce2134d1962a000af89834

Widen the site

view details

push time in a month

push eventhumaans/next-img

Karolis Narkevicius

commit sha f2670716ceeca96f6e5b8da2ae44803b92a5aeb8

Updates

view details

push time in a month

push eventhumaans/next-img

Karolis Narkevicius

commit sha 337543decaa6dba5ddbc51ec0640ed37e3e0e0c4

Updates

view details

push time in a month

push eventhumaans/next-img

Karolis Narkevicius

commit sha c7d76729df60f069de51403553f4edafdc36ef07

Updates

view details

push time in a month

push eventhumaans/next-img

Karolis Narkevicius

commit sha 9598ac891056a687be73f232b01296f63ec75610

Updates

view details

push time in a month

push eventhumaans/next-img

Karolis Narkevicius

commit sha 104c3a662b44d2384fb38357cc1f85126c4ce5e5

Fully fleshed out examples page

view details

Karolis Narkevicius

commit sha 8967fd8566865867abc9b143b1b15e7ea49bc8d8

Coerce nested query params

view details

push time in a month

issue openedhumaans/next-img

When no ?sizes specified, only embed 1 image at original size

Right now, it embeds the same image (with different file name) twice as seen in Example 4.

This is more to do with how we don't filter out dupe widths, when we can't scale up an image. E.g. asking to resize image of 800px to 800px and 1600px will produce same image twice of 800px@1x and 800px@2x.

created time in a month

push eventhumaans/next-img

Karolis Narkevicius

commit sha 06c48d8119ef6267c08040000b7e062a7d3aaa76

Updates

view details

push time in a month

push eventhumaans/next-img

Karolis Narkevicius

commit sha f4c32115f235be4688660ccd8367afb5592e7231

Update examples site, update readme

view details

push time in a month

create barnchhumaans/next-img

branch : gh-pages

created branch time in a month

push eventhumaans/next-img

Karolis Narkevicius

commit sha 45298731620d7c32fffae3945bce0045ded8cd21

Split the settings for jpg->webp and png->webp

view details

Karolis Narkevicius

commit sha 41928f73a64c14000ff0232e18c9a3cfaef58c9b

Update README and assets

view details

Karolis Narkevicius

commit sha e93342f8d81812c337effa191788cc65c36aecf6

Update docs site

view details

push time in a month

created taghumaans/next-img

tagv0.1.1

A Next.js plugin for embedding optimized images.

created time in a month

push eventhumaans/next-img

Karolis Narkevicius

commit sha 05bb6a60bec12c52936485cf73432456f7996156

0.1.1

view details

push time in a month

push eventhumaans/next-img

Karolis Narkevicius

commit sha ef5465bbb191568160ff5d132d25733c6a729f93

Reinstall pkgs

view details

push time in a month

push eventhumaans/next-img

Karolis Narkevicius

commit sha add24d7641dfd4078d8e9a6fe718022fe6f7dd7a

Remove console.logs

view details

push time in a month

push eventhumaans/next-img

Karolis Narkevicius

commit sha 6b4bbce1a86d8174f5a7f6da18b250b9532a9983

0.1.0

view details

push time in a month

created taghumaans/next-img

tagv0.1.0

A Next.js plugin for embedding optimized images.

created time in a month

push eventhumaans/next-img

Karolis Narkevicius

commit sha 23dd6ec9a7b8026b8ffad8fee4f7c60506665e49

Fix linting

view details

push time in a month

issue commentnumso/prettier-standard-vscode

Option to only run when .prettierrc file exists

Personally, I've since moved to using prettier with the official prettier extension and healthier, which has vscode/sublime extensions.

This way I get my editor to apply prettier only if .prettierrc config is present and I get all the linting done by healthier which uses all standard rules that don't conflict with prettier.

KidkArolis

comment created time in a month

startedfulcrologic/fulcro

started time in 2 months

startedomcljs/om

started time in 2 months

issue closedhumaans/figbird

useFind returns the same item multiple times

Hi All,

First off, great library! I was going to build out something similar until I came upon this. Thanks for saving me a bunch of time.

When using the useFind hook, It seems to return the first result for every result. Here is what I am using:

const { loading, error, data } = useFind('templates', { query: {}, });

Result in component: The first result repeated 5 times.

Result verified in websocket return : Correct.

Any idea what may be causing this?

closed time in 2 months

johnatspreadstreet

issue commenthumaans/figbird

useFind returns the same item multiple times

The latest version logs a warning if ID is missing to help catch this case.

If the dynamic ID issue is still relevant, please reopen as a new issue and we can get that implemented.

johnatspreadstreet

comment created time in 2 months

issue commenthumaans/figbird

Handle expired token error

You might be able to do so in your feathers client setup (regardless of whether you're using websocket or rest, since feathers abstracts both the same way). This is what we do:

import createFeathersClient from '@feathersjs/feathers'
import auth from '@feathersjs/authentication-client'
import socketio from '@feathersjs/socketio-client'
import io from 'socket.io-client'

export function createFeathers() {
  const socket = io()
  const feathers = createFeathersClient()
  feathers.configure(socketio(socket))
  feathers.configure(
    auth({
      storage: window.localStorage,
      storageKey: 'access-token',
      path: 'api/authentication',
      Authentication: AuthenticationClient,
    }),
  )

  feathers.hooks({
    before: {
      all: [],
    },
    error: {
      all: [handleUnauthenticated()],
    },
  })

  return feathers
}

class AuthenticationClient extends auth.AuthenticationClient {
  handleError(error, type) {
    if (error.code === 401 || error.code === 404) {
      const promise = this.removeAccessToken().then(() => this.reset())

      return type === 'logout'
        ? promise
        : promise.then(() => Promise.reject(error))
    }

    return Promise.reject(error)
  }
}

function handleUnauthenticated() {
  return context => {
    const { error } = context

    // The server is responding with 401s, that means the token is expired,
    // or invalid, etc.
    // The other case is when the socket is not connected, then we
    // do not want to reload the page, we just want to wait for the socket
    // to reconnect and reauthenticate, this is typically due to temporary
    // loss of server connection
    if (error.name === 'NotAuthenticated') {
      if (window.location.pathname !== '/login') {
        window.location.reload()
      }
    }
  }
}

There are 2 things relevant in the snippet above:

  1. Customizing how handleError of Feathers AuthenticationClient handles the authentication error (e.g. handling 401s and 404s instead of the Feathers default 401 and 403).
  2. Most relevant to your question - installing a client side error hook handleUnauthenticated which gets called on any failed requests. In our case we reload the page (which then redirects to the login page).

Let me know if this helps.

darrenkeenfanduel

comment created time in 2 months

issue commentfeathersjs/schema

RFC - a place to discuss and refine the API

Hi, I'm not very familiar with the scope and goals of @featherjs/schema, but wanted to share a couple of learnings from using ajv with Feathers.

Ajv async validators

Ajv does support async validators, I use that feature to check things based on context or database. E.g. I've build custom validation keywords such as:

  • foreignKey (checks DB for that key)
  • internal (checks if provider is set before allowing to modify that field)
  • permission (for some field based authorization based on permissions in DB)

This isn't to try and sway you away from yup, just wanted to point out that ajv supports this. The main difference is that it doesn't support inline validation functions (that I know of). For those cases I tend to do extra work in my hooks.

Read vs create vs update

For all my resources, I tend to need 3 things:

  • what's the schema for creating
  • what's the schema for updating
  • what fields can the requesting user read

For that I actually export each of these definitions separately. I was wondering how you were thinking about handling that here.

A typical schema file (e.g. foo.schemas.js) ends up looking like this:

const fields = [
  'id',
  'personId',
  'name',
  'email',
  'phoneNumber',
  'formattedPhoneNumber', // derived in a hook
  'relationship',
  'primary',
  'createdAt',
  'updatedAt',
]

const patch = {
  type: 'object',
  properties: {
    name: { type: 'string' },
    email: { type: 'string', nullable: true },
    phoneNumber: { type: 'string', nullable: true },
    relationship: { type: 'string', nullable: true },
  },
  additionalProperties: false,
}

const create = {
  ...patch,
  properties: {
    ...patch.properties,
    personId: { type: 'string' },
    primary: { type: 'boolean' },
  },
  required: ['personId', 'name'],
}

module.exports.create = create
module.exports.patch = patch

module.exports.read = {
  owner: fields,
  admin: fields,
  user fields,
  self: fields,
}
DesignByOnyx

comment created time in 2 months

startedTheSinding/authentication-api-key

started time in 2 months

pull request commentfeathersjs/feathers

fix(authentication-oauth): Allow req.feathers to be used in oAuth authentication requests

Hm.. thanks for pointing that out, I might have to restrict that edge case further.

Thing is, the "protections" often depend on the user accessing the data, but in this case - there is no user.. unless we find the entity and then re-find it again with the user passed in, the way it's done in the jwt strategy, basically.

daffl

comment created time in 3 months

pull request commentfeathersjs/feathers

fix(authentication-oauth): Allow req.feathers to be used in oAuth authentication requests

Re posting from Slack:

This means params.provider = ‘rest’ is set now, and before it wasn’t, this can affect logic such as looking up entities via findEntity. In my case, findEntity (to find user) stopped working, because the request appeared to be external (due to provider being set), and you’re not allowed to get users if you’re not authenticated.

I need to update my logic to exclude provider in the oauth flow. But wondering if this could affect other peeps.

Perhaps Feathers oauth strategy should be updated to exclude provider somewhere in the flow of authenticate -> findEntity? (since this isn’t an external request, this is oauth internally trying to resolve an entity).

daffl

comment created time in 3 months

push eventKidkArolis/workalendar

Karolis Narkevicius

commit sha 620f77a34804c69a9ee082f205fd59e32930bfc9

Add Kenyan calendar

view details

Bruno Bord

commit sha 5f20d06d42cbd4593edd45ac9221afcae35c7227

Merge pull request #484 from KidkArolis/add-kenya Add Kenyan calendar

view details

Bruno Bord

commit sha 67feaab1b985946af3a47336c36736810ed2092d

Fixed Lithuania calender to use the core flags for Assumption and All Saints closes #468

view details

Bruno Bord

commit sha b73f8e638bebafac95e706d6e1edbc544b4ecaf5

Merge pull request #486 from peopledoc/lithuania-fix-assumption Fixed Lithuania calender to use the core flags for Assumption and All Saints

view details

Bruno Bord

commit sha a80adc1fc3cc1d94231d569fdda21336df285c7d

Fixed Malta calendar - January 1st was already included There was no need to add it to the ``FIXED_HOLIDAYS`` property. closes #469

view details

Bruno Bord

commit sha 45bb9fb83743c93154e251fb8782263a7cf8b836

Merge pull request #487 from peopledoc/malta-new-year Fixed Malta calendar - January 1st was already included

view details

Bruno Bord

commit sha d87de8cadfe1c49340e4234b6013b6c77be510d8

Small refactor in Netherlands calendar to use core constants closes #470

view details

Bruno Bord

commit sha 011aece3c992a2aa4532d45f19f1afc9c63da422

Merge pull request #488 from peopledoc/netherlands-day-constants Small refactor in Netherlands calendar to use core constants

view details

Bruno Bord

commit sha 3c00cf98ce9d53be9daadc988f157847efca8dbb

v8.4.0 **New Calendar** - Added Kenyan calendar, by @KidkArolis (#484) **Minor fixes** - Fixed Lithuania calendar to use the core flags for Assumption and All Saints (#468). - Fixed Malta calendar ; January 1st was already included, no need to add it to the ``FIXED_HOLIDAYS`` property (#469). - Small refactor in Netherlands calendar to use core constants (#470).

view details

Bruno Bord

commit sha c5c5a39834beff9ca676b18c9578adbd1966e8da

Back to development => 8.5.0.dev0

view details

push time in 3 months

PR opened peopledoc/workalendar

Rename all shifted days to " Shift" for consistency

This one's change a suggestion. It makes it easier to rename such holidays in your own code, e.g. by replacing " Shift" with " Substitute" or " (in lieau)". Unless there was some method to the madness (I mean, perhaps the inconsistencies were there for a reason..).

  • [x] Tests with a significant number of years to be tested for your calendar.
  • [ ] Changelog amended with a mention like: "Added <country> by @pseudo (#)".

<!-- Release management

  • Commit for the tag:
    • [ ] Edit version in setup.py
    • [ ] Add version in Changelog.md ; trim things
    • [ ] Push & wait for the tests to be green
    • [ ] tag me.
    • [ ] build sdist + wheel packages (make package)
  • Back to dev commit:
    • [ ] Edit version in setup.py
    • [ ] Add the "master / nothing to see here" in Changelog.md
    • [ ] Push & wait for the tests to be green
  • [ ] Merge --ff
  • Github stuff
    • [ ] Push tag in Github
    • [ ] Edit release on Github using the changelog.
    • [ ] Delete branch
  • [ ] upload release on PyPI using twine
  • [ ] (optional) Make feeback on the various PR or issues.

-->

+40 -40

0 comment

15 changed files

pr created time in 3 months

create barnchKidkArolis/workalendar

branch : consistent-shift

created branch time in 3 months

pull request commentpeopledoc/workalendar

Add Kenyan calendar

Amended

KidkArolis

comment created time in 3 months

push eventKidkArolis/workalendar

Karolis Narkevicius

commit sha 620f77a34804c69a9ee082f205fd59e32930bfc9

Add Kenyan calendar

view details

push time in 3 months

startedpubkey/event-reduce

started time in 3 months

pull request commentpeopledoc/workalendar

Add Kenyan calendar

Fixed the linting.

KidkArolis

comment created time in 3 months

push eventKidkArolis/workalendar

Karolis Narkevicius

commit sha ecce5275c28977be2e89cdf1e30b0c14f6a85370

Add Kenyan calendar

view details

push time in 3 months

Pull request review commentpeopledoc/workalendar

Add Kenyan calendar

+from copy import copy+from datetime import timedelta, date++from ..core import WesternCalendar, IslamicMixin, ChristianMixin+from ..registry_tools import iso_register++SUN = 6++@iso_register('KE')+class Kenya(WesternCalendar, IslamicMixin, ChristianMixin):+    "Kenya"+    include_good_friday = True+    include_easter_monday = True+    # Islamic holidays+    include_eid_al_fitr = True+    include_day_of_sacrifice = True+    shift_sunday_holidays = True++    FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (+        (5, 1, "Labour Day"),+        (6, 1, "Madaraka Day"),+        (10, 20, "Mashujaa Day"),+        (12, 12, "Jamhuri Day"),+        (12, 31, "New Years Eve"),+    )++    def get_fixed_holidays(self, year):+        days = super().get_fixed_holidays(year)++        if year >= 2020:+            days.append((date(year, 2, 11), 'Moi Memorial Day'))++        # Moi Day renamed+        huduma_day_label = "Moi Day"+        if year >= 2020:+            huduma_day_label = "Huduma Day"+        days.append((date(year, 10, 10), huduma_day_label))++        # Boxing day renamed+        boxing_day_label = "Boxing Day"+        if year >= 2020:+            boxing_day_label = "Utamaduni Day"+        days.append((date(year, 12, 26), boxing_day_label))++        return days++    def get_shifted_holidays(self, dates):

Added these next two methods to shift Sundays to Mondays, but I've excluded the Islamic days from being shifted.

KidkArolis

comment created time in 3 months

Pull request review commentpeopledoc/workalendar

Add Kenyan calendar

+from copy import copy+from datetime import timedelta, date++from ..core import WesternCalendar, IslamicMixin, ChristianMixin+from ..registry_tools import iso_register++SUN = 6++@iso_register('KE')+class Kenya(WesternCalendar, IslamicMixin, ChristianMixin):+    "Kenya"+    include_good_friday = True+    include_easter_monday = True+    # Islamic holidays+    include_eid_al_fitr = True+    include_day_of_sacrifice = True+    shift_sunday_holidays = True++    FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (+        (5, 1, "Labour Day"),+        (6, 1, "Madaraka Day"),+        (10, 20, "Mashujaa Day"),+        (12, 12, "Jamhuri Day"),+        (12, 31, "New Years Eve"),+    )++    def get_fixed_holidays(self, year):

Added this to dynamically introduce 'Moi Memorial Day' in 2020 and to rename some things based on year.

KidkArolis

comment created time in 3 months

PR opened peopledoc/workalendar

Add Kenyan calendar
  • [x] Tests with a significant number of years to be tested for your calendar.

  • [x] Docstrings for the Calendar class and specific methods.

  • [x] Use the workalendar.registry_tools.iso_register decorator to register your new calendar using ISO codes (optional).

  • [x] Calendar country / label added to the README.rst file.

  • [x] Changelog amended with a mention like: "Added <country> by @pseudo (#)".

  • Commit for the tag:

    • [ ] Edit version in setup.py
    • [ ] Add version in Changelog.md ; trim things
    • [ ] Push & wait for the tests to be green
    • [ ] tag me.
    • [ ] build sdist + wheel packages (make package)
  • Back to dev commit:

    • [ ] Edit version in setup.py
    • [ ] Add the "master / nothing to see here" in Changelog.md
    • [ ] Push & wait for the tests to be green
  • [ ] Merge --ff

  • Github stuff

    • [ ] Push tag in Github
    • [ ] Edit release on Github using the changelog.
    • [ ] Delete branch
  • [ ] upload release on PyPI using twine

  • [ ] (optional) Make feeback on the various PR or issues.

+117 -1

0 comment

5 changed files

pr created time in 3 months

create barnchKidkArolis/workalendar

branch : add-kenya

created branch time in 3 months

push eventKidkArolis/workalendar

Luis Malta

commit sha e9188f60c7d4c2131ca8495635160a9fe215e692

Add more holidays in brazilian states

view details

Luis Malta

commit sha 7daf8dc7d3a33deb78acbeeb225f3890d6e7e94b

Add IBGE codes to iso_register for brazilian holidays

view details

Luis Malta

commit sha 7ccb7e70778a039f9a90df56c3378377efc5908b

Improves tests for Brazilian holidays

view details

Luis Malta

commit sha 8ed61197e61e5147bca6cdce8aeb596395bb72d5

Fix PEP8

view details

Luis Malta

commit sha 791fa702e209b6f87a6fd31fd51e5c20dd8cd376

Register accept multiple iso_registry arguments

view details

Luis Malta

commit sha 85fed4bc3a9d7ba11309eaafd1be99a1f035aff2

Return the state case the city was not found

view details

Luis Malta

commit sha a31c0ef3c0aa4fc2c73708f2e30d0809675d07a1

Adapt get_subregions to return the cities for brazilian states

view details

Luis Malta

commit sha 4a5cd495dcae2c3986fb9b4ec5783c40c6847d9c

Include consciencia negra and easter sunday in Brazil Calendar and ash wednesday in BrazilBankCalendar

view details

Luis Malta

commit sha eb5f3db33bf607b21dfc132127e873c9722c687e

Add script to get all brazilian state with their respective type and coverage

view details

Bruno Bord

commit sha dda55ea102c4e2dc44a38d10d3e25030d5eec88b

Build IBGE registry for Brazil calendars

view details

Bruno Bord

commit sha dc23834099a7b83070bf3ed9c950ba156deb8a7b

Revert IBGE (Brazil) related changes in the ISO registry modules

view details

Bruno Bord

commit sha 2a627b2a23526a558b2f69dce549ed935a946f0c

Remove unused Brazil-related module. This module was awkwardly put at the root of workalendar's module and is beyond the scope of this library.

view details

Bruno Bord

commit sha 751a55c3c99315f62de27df2f4afc28b08ce81e6

Changelog updates - Added 27 Brazil calendars -- thanks a lot to @luismalta & @mileo, (#409 & #415), - Fixes and additions to some calendars -- again, thanks to @luismalta & @mileo, (#409 & #415) - Added an IGBE_REGISTER to reference IGBE (brazilian) calendars with related tests (#415).

view details

Bruno Bord

commit sha e61735d07aaf2a90147774563640ce7ed077645d

Merge pull request #415 from peopledoc/more_brazilian_holidays_ibge More brazilian holidays + IBGE register

view details

Bruno Bord

commit sha f4f0f96302ad792ceba1db3408f6316dad01160c

Improve registry tests refs #412 * Dropped unused lines in tests * Trying to register a class that doesn't inherit from the core calendar class should raise an exception

view details

Bruno Bord

commit sha 5e9ae44f2138d12752a2edae1db1333c78b0f800

Merge pull request #413 from peopledoc/412-improve-registry-tests Improve registry tests

view details

Karolis Narkevicius

commit sha 6878077bf61261291491ad6a0d29a64d876eeade

Fix Denmark - re-add Christmas Eve Sources: - https://www.officeholidays.com/countries/denmark - https://www.feiertagskalender.ch/index.php?geo=3289&klasse=0&hl=en

view details

Bruno Bord

commit sha eb3f5bc0570b25a93cc67a04944c5f8194883882

v7.1.0 **New calendars** - Added 27 Brazil calendars -- thanks a lot to @luismalta & @mileo, (#409 & #415) **Enhancements** - Added compatibility with Python 3.8 (#406). - Added an IBGE_REGISTER to reference IBGE (brazilian) calendars with related tests (#415). - Improve ISO registry interface by raising an error when trying to register a non-Calendar class (#412). **Other changes** - Fixes and additions to some Brazil calendars ; again, thanks to @luismalta & @mileo, (#409 & #415) - Fix Denmark, re-add Christmas Eve, which is widely treated as public holiday ; thx to @KidkArolis, (#414). - Increase Malaysia coverage by adding tests for missing Deepavali & Thaipusam. - Increase China coverage by adding tests for special extra-holidays & extra-working days cases.

view details

Bruno Bord

commit sha 46509d9d9d93495f80db0ea068a389dcea9e1a70

Back to development => 7.2.0.dev0

view details

Christopher Wittlinger

commit sha a9b697ff664276f156111b1ff568f0e194bc96fb

Added the public holidays from geneva, switzerland

view details

push time in 3 months

created taghumaans/figbird

tagv0.7.1

Effortless realtime data management for React + Feathers applications

created time in 3 months

push eventhumaans/figbird

Karolis Narkevicius

commit sha d6319ed7810d6d849043eaa72c7464da84d37f8d

0.7.1

view details

push time in 3 months

push eventhumaans/figbird

Karolis Narkevicius

commit sha 167c3af414008a62d92153f70451f4979208739b

Updates

view details

push time in 3 months

push eventhumaans/figbird

Karolis Narkevicius

commit sha 32609689631474410d5b386dcd3571c05b97cadc

Fix example

view details

Karolis Narkevicius

commit sha bc26a23889b7fbb8ede8a4dd3aef92a78500396b

Fix main/module

view details

push time in 3 months

Pull request review commentfeathersjs/docs

Add some explanation for the core concepts around channels

 Some examples where channels are used: - Only admins should be notified when new users are created - When a user is created, modified or removed, non-admins should only receive a "safe" version of the user object (e.g. only `email`, `id` and `avatar`) +## Concepts++When using channels, the server pushes events (such as "created", "removed" etc. for a particular service) down to its clients via *channels*. The client doesn’t listen to these channels directly, but rather subscribes to specific events (e.g. on services) that it is interested in. Those events will only fire if the server pushes relevant data down a channel that the client is connected to.
When using channels, the server pushes events (such as "created", "removed" etc. for a particular service) down to its clients via *channels*. The client doesn’t listen to individual channels directly, but rather subscribes to specific events on services that it is interested in. Those events will only fire on the client if the server pushes data to one or more channels that the client has been added to.
optilude

comment created time in 3 months

more