- Last 7 days
-
emergencemagazine.org emergencemagazine.org
-
You describe how foundational stories of our Western, Christian paradigm are based on this idea of “a self-enclosed human realm separate from everything else,” and that this paradigm is a wound—one “so complete we can’t see it anymore, for it defines the very nature of what we assume ourselves to be.”
for - human bubble, ailenated from nature, human world so different from natural world - nice meme - self-enclosed human realm separate from everything else - Emergence Magazine - interview - An Ethics of Wild Mind - David Hinton
-
- Dec 2024
-
www.youtube.com www.youtube.com
-
we kept looking at the a couple of assumptions and it was assuming almost a linear journey of we're going to take the power and the money from the elites and we're going to put it in the hands of the community and the peoples and what we know throughout history is many different social movements over the past hundreds of years have endeavored to make that shift. But unless we actually get down into the deeper thought forms that underlie power and domination themselves, we're not actually in a cold, liberatory kind of framework
for - quote / key insight - must interrogate the deeper thought patterns else - we risk repeating simplistic linear transition social movements that have failed over the past centuries - Post Capitalist Philanthropy Webinar 1 - Alnoor Ladha - Lynn Murphy - 2023
Tags
Annotators
URL
-
- Nov 2024
-
www.youtube.com www.youtube.com
-
once you realize that the world isn't what you think it is it's very easy to grab onto something else and grab onto some kind of weird conspiracy well that's the thing you've been describing thus far as well sorry to in just say but like the openness requires structure
for - quote conspiracy theories - lizard people - first stage of initiation - if reality isn't as it appears, it's easy to latch onto something else - John Churchill
-
- Sep 2024
-
blog.nodejitsu.com blog.nodejitsu.com
-
Developers want to improve their project. If you find an issue, bring it up. If it's a valid concern, the author will probably want to have it fixed. In many cases, the author will consider it a valid issue, but simply not have the personal time or need to address it immediately. This is where open-source is great. Just fork the project and fix it
-
- Jan 2024
-
mongoosejs.com mongoosejs.com
-
Instance methods Instances of Models are documents. Documents have many of their own built-in instance methods. We may also define our own custom document instance methods. // define a schema const animalSchema = new Schema({ name: String, type: String }, { // Assign a function to the "methods" object of our animalSchema through schema options. // By following this approach, there is no need to create a separate TS type to define the type of the instance functions. methods: { findSimilarTypes(cb) { return mongoose.model('Animal').find({ type: this.type }, cb); } } }); // Or, assign a function to the "methods" object of our animalSchema animalSchema.methods.findSimilarTypes = function(cb) { return mongoose.model('Animal').find({ type: this.type }, cb); }; Now all of our animal instances have a findSimilarTypes method available to them. const Animal = mongoose.model('Animal', animalSchema); const dog = new Animal({ type: 'dog' }); dog.findSimilarTypes((err, dogs) => { console.log(dogs); // woof }); Overwriting a default mongoose document method may lead to unpredictable results. See this for more details. The example above uses the Schema.methods object directly to save an instance method. You can also use the Schema.method() helper as described here. Do not declare methods using ES6 arrow functions (=>). Arrow functions explicitly prevent binding this, so your method will not have access to the document and the above examples will not work.
Certainly! Let's break down the provided code snippets:
1. What is it and why is it used?
In Mongoose, a schema is a blueprint for defining the structure of documents within a collection. When you define a schema, you can also attach methods to it. These methods become instance methods, meaning they are available on the individual documents (instances) created from that schema.
Instance methods are useful for encapsulating functionality related to a specific document or model instance. They allow you to define custom behavior that can be executed on a specific document. In the given example, the
findSimilarTypes
method is added to instances of theAnimal
model, making it easy to find other animals of the same type.2. Syntax:
Using
methods
object directly in the schema options:javascript const animalSchema = new Schema( { name: String, type: String }, { methods: { findSimilarTypes(cb) { return mongoose.model('Animal').find({ type: this.type }, cb); } } } );
Using
methods
object directly in the schema:javascript animalSchema.methods.findSimilarTypes = function(cb) { return mongoose.model('Animal').find({ type: this.type }, cb); };
Using
Schema.method()
helper:javascript animalSchema.method('findSimilarTypes', function(cb) { return mongoose.model('Animal').find({ type: this.type }, cb); });
3. Explanation in Simple Words with Examples:
Why it's Used:
Imagine you have a collection of animals in your database, and you want to find other animals of the same type. Instead of writing the same logic repeatedly, you can define a method that can be called on each animal instance to find similar types. This helps in keeping your code DRY (Don't Repeat Yourself) and makes it easier to maintain.
Example:
```javascript const mongoose = require('mongoose'); const { Schema } = mongoose;
// Define a schema with a custom instance method const animalSchema = new Schema({ name: String, type: String });
// Add a custom instance method to find similar types animalSchema.methods.findSimilarTypes = function(cb) { return mongoose.model('Animal').find({ type: this.type }, cb); };
// Create the Animal model using the schema const Animal = mongoose.model('Animal', animalSchema);
// Create an instance of Animal const dog = new Animal({ type: 'dog', name: 'Buddy' });
// Use the custom method to find similar types dog.findSimilarTypes((err, similarAnimals) => { console.log(similarAnimals); }); ```
In this example,
findSimilarTypes
is a custom instance method added to theAnimal
schema. When you create an instance of theAnimal
model (e.g., a dog), you can then callfindSimilarTypes
on that instance to find other animals with the same type. The method uses thethis.type
property, which refers to the type of the current animal instance. This allows you to easily reuse the logic for finding similar types across different instances of theAnimal
model.
Tags
Annotators
URL
-
- Nov 2023
-
github.com github.com
-
Yeah, I agree that lib (or app/lib
-
The real fundamental problem is that lib is a kitchen sink
-
Everything has a place so do better and find it. There is a certain belief that everything within app should be organized into functionally-named directories and any files placed in app/lib actually belongs in app/services or app/interactors or app/models or someplace if the developers just tried harder. The implication is that developers are bad developers if they don’t yet know what kind of constant they have and where its forever home should be. I reject this. Over the lifespan of an application, there will be constants that have not yet found their functional kin, if those kin ever come to exist at all; sometimes you simply need some code and a place to put it. app/lib can be the convention for where those constants can live temporarily or as long as necessary. Autoloading is really nice, let’s treat them to it.
-
- Jan 2023
-
github.com github.com
-
Do you plan to continue merging MR and releaseing new versions for this Gem? I don't think there is any similar gem like this, so it would be sad to see it fade away.
-
- Apr 2021
-
github.com github.com
-
I don't believe the sprockets and sprockets-rails maintainers (actually it's up to the Rails maintainers, see rails/rails#28430) currently consider it broken. (I am not a committer/maintainer on any of those projects). So there is no point in "waiting for someone else to fix" it; that is not going to happen (unless you can change their minds). You just need to figure out the right way to use sprockets 4 with rails as it is.
Tags
- at the mercy of maintainer
- whether maintainer or contributor should/will implement something
- waiting for someone else to fix it: that is not going to happen
- whose responsibility is it?
- frustrating when maintainers stubbornly stick to opinions/principles/decisions and won't change despite popular user support
Annotators
URL
-
- Mar 2021
-
github.com github.com
-
And we shave off 6 or so seconds, that is huge.
-
Since the common problem with concatenating JavaScript files is the lack of semicolons, automatically adding one (that, like Sam said, will then be removed by the minifier if it's unnecessary) seems on the surface to be a perfectly fine speed optimization.
-
- Jan 2021
-
-
At work, I cannot maintain this project. At home, I'd rather spend time with my children and on projects that I'm currently passionate about.
-
- Dec 2020
-
github.com github.com
-
Unless we choose to use the semver ju-jitsu of calling the changes a bugfix
-
- Nov 2020
-
github.com github.com
-
There are a few intentional behavioral differences between Dart Sass and Ruby Sass. These are generally places where Ruby Sass has an undesired behavior, and it's substantially easier to implement the correct behavior than it would be to implement compatible behavior. These should all have tracking bugs against Ruby Sass to update the reference behavior.
Tags
- learn from your mistakes
- reference implementation
- don't let previous decisions/work constrain you
- get back on course
- intentional
- reverting a previous decision/change/commit
- intentionally doing it differently / _not_ emulating/copying the way someone else did it
- reversible decisions
- intentional/well-considered decisions
Annotators
URL
-
- Oct 2020
-
www.npmjs.com www.npmjs.comhyperx1
-
http://facebook.github.io/jsx/#why-not-template-literals (respectfully disagree)
-
-
medium.com medium.com
-
Svelte chooses a reverse approach.
-
-
github.com github.com
-
While react hooks were one of the catalysts for v3 we don't agree with with the APIs or the model and won't be emulating it.
-
-
-
It was clear no one was interested in what I was working towards.
-
- Oct 2019
-
miro.medium.com miro.medium.com
Tags
Annotators
URL
-
- Sep 2018
-
hypothes.is hypothes.is
-
Getting started
Testuing
Tags
Annotators
URL
-
- Mar 2016
-
www.sciencedirect.com.ez-proxy.brooklyn.cuny.edu:2048 www.sciencedirect.com.ez-proxy.brooklyn.cuny.edu:2048
-
On average 2500 tonnes are ascribed to jewellery and 1000 tonnes are ascribed to retail investors, Exchange Traded Funds (ETFs) and industrial production in the last 10 years
2/3 jewelery 1/3 banks/investors + industrial production
-