19,785 Matching Annotations
  1. Jul 2021
    1. Sure, the slow way is always "good enough" — until you learn a better way of doing things. By your logic, then, we shouldn't have the option of including "Move to" in our context menus either — because any move operation could be performed using the cut and paste operations instead? The method you proposed is 6-7 steps long, with step 4 being the most onerous when you're in a hurry: Select files "Cut" "Create New Folder" Think of a name for the new folder. Manually type in that name, without any help from the tool. (We can't even use copy and paste to copy some part of one of the file names, for example, because the clipboard buffer is already being used for the file selection.) Press Enter Press Enter again to enter the new folder (or use "Paste Into Folder") "Paste" The method that Nautilus (and apparently Mac's Finder) provides (which I and others love) is much more efficient, especially because it makes step 4 above optional by providing a default name based on the selection, coming in at 4-5 steps (would be 3 steps if we could assign a keyboard shortcut to this command like Mac apparently has ): Select files Bring up context menu (a direct shortcut key would make this even sweeter) Choose "New Folder With Selection" Either accept the default name or choose a different name (optional) Press Enter Assuming "Sort folders before files" option is unchecked, you can continue working/sorting in this outer folder, right where you left off: Can you see how this method might be preferable when you have a folder with 100s or 1000s of files you want to organize it into subfolders? Especially when there is already a common filename prefix (such as a date) that you can use to group related files together. And since Nemo kindly allows us to choose which commands to include in our context menu, those who don't use/like this workflow are free to exclude it from their menus... Having more than one way to accomplish something isn't necessarily a bad thing.
    2. Has the Linux Mint team decided whether it might please add this sorely missed feature? I'm keeping Nautilus around in addition to Nemo just for this one feature. This feature is so much more efficient than other methods when you have a giant folder of many files and want to organize it into subfolders (which you can then easily move or rename afterwards — but at least this helps with the first step, which is to get the correct files into a folder together). P.S. This was also requested in #560.
    1. Cheers, I never do random PPA's but just thought there was one from who-ever made Nemo
    2. There is no such thing as a "correct PPA". PPA is a personal package archive created by some user. You install software from PPA's at your own risk.

      "correct"

    1. WARNING: I suspect FAKE or "purchased" positive reviews as there is at least one "positive" review that already shows almost 100 hours of game time.. and well this game is nothing but a mess of cobbled together assets off of the Unreal asset marketplace
    1. just another coppy of a game witch allredy exist on steam, you just need to find it
    1. ORANGE SWAN uses brand-new mechanics that offer the right balance between historical flavor,  ease of play, and replay value.
    1. One can also use sophisticated statistic software, such as RRR (free, but not that easy to use, overkill).
    1. Have your wife stand on the handles of a bakers rolling pin, while you push and pull her around!

      make-shift

    1. If the screen doesn't progress from "Activating...", either try in another web browser or try in the current browser after clearing cookies then contact with us if the issue persists.

      .

    1. This new edition is based on an exhaustive two-year study by the Designer of the records that have come to light since the fall of the Berlin Wall. The game combines highly accurate information on the forces the Warsaw Pact actually had with now de-classified reports from the CIA and the Defense Intelligence Agency regarding what satellite surveillance and HUMINT revealed about their actual plans.
    1. Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues. If you have found a problem that seems similar to this, please open a new issue.
    1. I will not be using BackerKit or GameFound or another third party pledge taker. I will just be using Kickstarter. I have found that some people have trouble with third party software.

      Okay... What kind of trouble?

    2. This Kickstarter was made to be run during WellyCon, New Zealand's board game convention (which carefully and successfully hosted the world's biggest live board game con in 2020!)
    1. This cache has a small trade-off! If we request a list of data, and the API returns an empty list, then the cache won't be able to see the __typename of said list and invalidate it.

      That's one big caveat!

    1. In 2.8 you can use conditional types to achieve a similar effect
    2. type CReturn<C, K extends keyof C> = C extends Array<any> ? C[number] : C[K];
    3. Prior to 2.9 keyof only returned string indexes, in 2.9 this will include numeric and symbol keys.
    4. const test = new Person(TestPerson).at("name").at("name")
    1. type FooType = { // interfaces or classes of course also possible bar: string; } type BarType = FooType['bar']; // BarType is a string now
    2. You would get a return value of the type "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function", because you're using the JavaScript typeof operator at runtime, which returns a string like "object", not the compile-time type seen by TypeScript.
    1. (This, incidentally, is why the current 'zero-config' marketing fad is such nonsense: it really means 'abdicate the responsibility for config'. Instead of a single place where you can view all the build config in a structured, coherent form, you have the exact same amount of config but scattered around your project in lots of annoying files that are harder to understand.)
    1. Bash is a wonderful and terrible language. It can provide extremely elegant solutions to common text processing and system management tasks, but it can also drag you into the depths of convoluted workarounds to accomplish menial jobs.
  2. Jun 2021
    1. if x.strip('%').isnumeric(): return float(x.strip('%'))/100
    2. .isnumeric() matches 430 Unicode codepoints in the BMP that float() won't accept, and there are codepoints that .isdigit() returns true for that are also not convertible.
    1. This is especially nice for opening Vim from other tools, as this call can be done on the command-line: "+call cursor($LINE,$COLUMN)"
    2. Be aware, for general usage, that this is screen column, not real column. This means that <Tab> characters will get different results. If these characters will be there, you will instead want |30lh or |29l or 029l or something like that.
    3. @DavidPope: note that in this case "screen columns" means that it's still relative to the start of the line. g0 achieves "start of current screen line".
    4. The vim documentation is hilarious: "Ceci n'est pas une pipe" :-)
    1. git diff-index --name-status --relative --cached @ might be a bit easier to parse (and only includes staged files so you don't have to do an extra step to filter them). Also, I couldn't use git status --porcelain because my Rails app is in a sub-folder so I needed the list of files to be relative to the Rails root instead of relative to the git repo root (although git status in general seems to respect the --relative option, git status --porcelain seems to not).
    1. Note that you could skip the https:// if you want a shorter command and you’re feeling adventurous with your HTTP MITM concerns, plus you can use the direct GitHub link as well if you don’t trust my redirect pointing there.
    2. We also get a hook to alter commit messages so that they include a common suffix. We can then use this to set up a server-side hook that refuses changes that don’t have this in their messages.
    3. This compatibility simply means that you can have a .githooks folder at the root of your project, where you can organize your individual hooks into folders.
    1. https://github.com/rycus86/githooks is a really option for managing hooks It is... safe (it uses an opt-in model, where it will ask for confirmation whether new or changed scripts should be run or not (or disabled)) configurable handles a lot of the details for you lets you keep your hooks nicely organized. For example:
    2. And from a security standpoint, that'd be really kind of scary - no one should have the ability to force me to execute certain scripts whenever I run certain git commands
    3. Luckily there is not a way to force hooks to people upon clone. If there was, you could write a post-receive hook with rm -rf / in it and wipe people's hard disk on pull
    1. If you want, you can try out what the script would do first, without changing anything. $ sh -c "$(curl -fsSL https://r.viktoradam.net/githooks)" -- --dry-run
    2. To try and make things a little bit more secure, Githooks checks if any new hooks were added we haven't run before, or if any of the existing ones have changed
    3. git diff --cached --diff-filter=ACMR --name-only
    1. Apologies for digging up a closed thread, but it already contains some monorepo examples so feels like the best place to do it.
    1. These days, Monorepo’s and Typescript are very popular, but configuring the development environment to work with both is still a fairly complex task.
    1. Today, Sass uses complex heuristics to figure out whether a / should be treated as division or a separator. Even then, as a separator it just produces an unquoted string that’s difficult to inspect from within Sass.
    2. Sass currently treats / as a division operation in some contexts and a separator in others. This makes it difficult for Sass users to tell what any given / will mean, and makes it hard to work with new CSS features that use / as a separator.
    1. Of course, I don't doubt your report and of course, I want this to work. Before I invest a lot of effort again into supporting Node.js's exotic "support" for ESM, though: would you mind trying whether upgrading to Node.js 14.17 solves the problem for you?
    1. Another important thing to remember is: don’t run npm install inside a sub-project. npm isn’t smart enough to figure out it’s inside a workspace and will assume it’s a normal project, create a local node_modules directory inside the sub-project, etc. I hope this changes soon and npm can detect the root package.json and perform the install up at the root.

      .

    2. 1) all dependencies of the root package + sub-packages are installed into a single node_modules folder at the root and 2) sub-packages are symlinked into node_modules during npm install.
    3. We’ve broken our project up into three different types of packages: apps which are preact apps intended to be bundled and deployed somewhere, modules which are plain npm packages for node/browsers and do not bundle their dependencies, and workers which are either Worker or ServiceWorker scripts entirely bundled up with no imports or exports. We don’t have to keep these three types of packages separated, but it helps us navigate around.
    1. But if you're working on a bigger project, with multiple packages and a complex dependency tree, you might want to combine npm with a tool like Lerna.
    2. Yarn has stated before that the goal of Yarn Workspaces is to provide low-level primitives for tools such as Lerna to use, not to compete with them.
    3. Yarn is constantly cited as prior art in the RFCs. I would be surprised to see big disparities between both CLIs.
    4. You can run all the "test" scripts at once by adding the --workspaces (plural) to your npm run command: # Run "test" script on all packages npm run test --workspaces # Tip - this also works: npm run test -ws
    5. Your packages (the ones you created)
    6. Dependencies are hoisted, meaning they get installed in the root node_modules folder. This is done for performance reasons: if a dependency is shared by multiple packages, it gets saved only once in the root.
    7. Other package managers such as Yarn and pnmp already ship with Workspaces for quite a while now.
    8. In fact, npm is not trying to reinvent the wheel. You can find similarities between all three Workspace implementations.
    1. This demonstrates how the nature of node_modules resolution allows for workspaces to enable a portable workflow for requiring each workspace in such a way that is also easy to publish these nested workspaces to be consumed elsewhere.
    1. Please make sure that your file(s) referenced in bin starts with #!/usr/bin/env node, otherwise the scripts are started without the node executable!
    1. Monorepo use cases
    2. Apart from that it’s just more convenient to have all your source files opened in a single IDE instance. You can jump from project to project without switching windows on your desktop.
    3. Why is it big news? Because the main advantage of npm over other package managers like yarn or pnpm is that it comes bundled with NodeJS.
    1. npm install <folder>: Install the package in the directory as a symlink in the current project. Its dependencies will be installed before it's linked. If <folder> sits inside the root of your project, its dependencies may be hoisted to the top-level node_modules as they would for other types of dependencies.
    1. The answer for me is @whitecolor's yalc.
    2. But this solution has technical complications, and the npm and the yarn implimentations give people trouble (as of this writing there are about 40 open npm link issues and over 150 open yarn link issues). If you have tried to use symlinked dependencies while developing a package you've probably run into into a stumbling block, whether simply an unexpected unlink behavior, trouble with peer dependencies, or something bigger.
    1. Selected state should be applied on the .mdc-list-item when it is likely to frequently change due to user choice. E.g., selecting one or more photos to share in Google Photos.Activated state is more permanent than selected state, and will NOT change soon relative to the lifetime of the page. Common examples are navigation components such as the list within a navigation drawer.
    2. In Material Design, the selected and activated states apply in different, mutually-exclusive situations:
    3. Do not use aria-orientation attribute for standard list (i.e., role="list"), use component's vertical property to set the orientation to vertical.
    1. When dealing with the verb, the issue of how to treat the past participle is a contentious one, with much blood being shed on both sides. Some people feel that the past participle of input should be input, not inputted, based on the reasoning that the word comes from put, and we don’t say “he putted the papers on the shelf.” A similar line of reasoning has caused many people to aver that words such as broadcast should never be written as broadcasted, since the cast portion of the word remains unchanged with tense.
    1. Integrated access to the pdb debugger and the Python profiler.
    1. ${0%/*} removes everything including and after the last / in the filename ${0##*/} removes everything before and including the last / in the filename
    1. Since looping over the positional parameters is such a common thing to do in scripts, for arg defaults to for arg in "$@". The double-quoted "$@" is special magic that causes each parameter to be used as a single word (or a single loop iteration). It's what you should be using at least 99% of the time.
    2. Bash (like all Bourne shells) has a special syntax for referring to the list of positional parameters one at a time, and $* isn't it. Neither is $@. Both of those expand to the list of words in your script's parameters, not to each parameter as a separate word.
    1. Instead of using a for loop, which will fail on spaces unless you redefine the IFS variable, I would recommend using a while loop combined with find.
    2. mmv1,2 is also a very nice tool for such a task, applied to the current job, it would be mmv '*.md' 'test - #1.md'
    1. Different ways to prepend a line: (echo 'line to prepend';cat file)|sponge file sed -i '1iline to prepend' file # GNU sed -i '' $'1i\\\nline to prepend\n' file # BSD printf %s\\n 0a 'line to prepend' . w|ed -s file perl -pi -e 'print"line to prepend\n"if$.==1' file
    1. From pretty format documentation: '%w([<w>[,<i1>[,<i2>]]])': switch line wrapping, like the -w option of git-shortlog[1]. And from shortlog: -w[<width>[,<indent1>[,<indent2>]]] Linewrap the output by wrapping each line at width. The first line of each entry is indented by indent1 spaces, and the second and subsequent lines are indented by indent2 spaces. width, indent1, and indent2 default to 76, 6 and 9 respectively. If width is 0 (zero) then indent the lines of the output without wrapping them.
    1. Although h.265 was released almost 5 years ago, adoption is slow. The primary reason for this, is that unlike h.264 which has 1 patent pool, h.265 has 3 patent pools with different pricing structures and terms & conditions. The second patent pool (HEVC Advance) was introduced in 2015, 3 years after the launch. This unclarity about the royalties situation around h.265 was hindering the adoption and as a result primary browsers have no support at all (e.g. Chrome, Firefox) or only partial support (Edge). Due to this, many content providers have stuck with h.264 because at least they know it will always play.

      patents

    1. Sort of. There are several systems around that have varying degrees of freedom. I have used Ivideon, which works fairly well as a docker-based environment, although it really needs its paid cloud back end to work well, and looked as Shinobi. If you are prepared to train your system, which can take some time, Shinobi is probably the best bet.
    1. "I am a huge fan of open source and am writing code myself. However Zoneminder is a mess. Been trying to use it for like 10 years. But it never worked reliably. More than 3 cameras almost always made it fail. RTSP never worked reliably. Shinobi took me minutes to set up on my mini PC and is feeling so reliable already. Reinventing the wheel may be bad. But let's face it: Zoneminder is doomed. The horse is dead. Let's get off."

      .

    2. I would suggest Shinobi as a NVR
    1. It is NOT an alarm, but it does alert you!

      What's the difference?

    2. always bring a few when staying in hotels or Airbnb’s and such. Can be removed with ease and be installed within a minute or 2

      .

    1. But after using it for a few days you quickly realize that there is one major privacy issue that has been installed consciously by Amazon and Ring.The ring app allows you to delete videos on the system but it does Not allow you to delete motion sensor and window sensor history.So Amazon/ring knows everything that happens inside your home and there is no way for you to delete that history. They know when you’re inside, they know when you open your door, they know when you closed it. etc. etc. etc. So they essentially know everything about you and your motions within your home.This is a major privacy issue. And it is not some mistake that was overlooked. This was a conscious choice on Amazon/rings part to track the motions of you and your family inside your own home.I spoke with the customer service rep from Ring and she admitted that many many people call up and complain that they can’t delete sensor history. Of course it would’ve been much more ethical to explain to potential customers BEFORE they buy ring products that this breach of privacy has been installed.But Amazon/ring does not warn their customers about this privacy breach. They don’t warn customers because they created the privacy breech and Will continue to have an always have very personal information on the motions of your family inside your own home.If you care about your privacy. Don’t buy Ring products.
    2. Why bother? Well, you never know if some crook has a device that can hack into your garage door opener!

      .

    1. What finally led me to write this review was that I recently received an offer containing 2 $20.00 gift cards to write a 5 star review. I wonder now if I had been duped by the reviews I read
    2.  I do not advise. I still do not understand where there are so many good reviews for this product. This vacuum cleaner is literally bursting at the seams.
    3. Soliciting five star reviews earns a one star.
    1. for cpp_file in *.cpp; do gcc -c $$cpp_file & done; wait This gives much finer control than make -j.
    2. Note that & is a line terminator like ; (write command& not command&;).
    3. There is one very important reason for enabling job control to be useful inside scripts: the side-effect it has of placing background processes in their own process groups. This makes it much, much easier to send signels to them and their children with one simple command: kill -<signal> -$pgid. All other ways of dealing with signaling entire trees of processes either involve elaborate (sometimes even recursive) functions, which are often bugnests, or risk killing the parent in the process (no pun intended).
    4. You particular circumstances may or may not warrant a way different from what lhunath (and other users) deem "best practices".
    5. Remember that in the end, especially in scripting, there always are more than one way to skin a cat, but some ways are more portable, more reliable, make it simpler to handle error cases, parse the output, etc.
    1. I hate mentee. The word is protégé.
    2. '...ee' is usually paired with an '..er', isn't it? Employee/Employer, Trainee/Trainer. I wouldn't use Coachee because to me, it implies you're a Coacher, not a Coach.

      Just because "...ee" is usually paired with an "...er" word doesn't mean it can never be paired with a non-"-er", non-"-or" word.

      I'm sure there are many examples of inconsistencies in English that we could point at to make that point...

    1. In your pull request, could you please add the index_errors option to the documentation of the has_many association, and may be refer to it in the accepts_nested_attributes_for method? The option is nowhere documented accept for the Rails 5.0 update readme.
    2. index_errors: true

      index_errors: true

    1. As you can see Rails already adds error messages from associated models and doing it wrongly: Merging together errors from different models under same has_many association. :"employments.company"=>["can't be blank"] And this is wrong.
    2. I have been waiting for a solution for this quite a while now.
    1. I wouldn't consider it switching behavior. Ultimately it's including a module -- either a manually defined and referenced one from the user, or a RSpec::Core::SharedExampleGroupModule created for the user when they defined the shared example group and referenced via the group name.
    2. The first argument to shared_context (the shared group name) is superfluous. It feels a bit like "what's this argument for again?" (Note that you could still use it with include_context to include the group manually, but it's a bit odd to mix-and-match the approaches).
    1. When we use a GraphQL API there are two kinds of errors we may encounter: Network Errors and GraphQL Errors from the API. Since it's common to encounter either of them, there's a CombinedError class that can hold and abstract either.
  3. spec.graphql.org spec.graphql.org
    1. GraphQL services should not provide any additional entries to the error format since they could conflict with additional entries that may be added in future versions of this specification.
    1. This kind of error handling does express error state (either via HTTP 500 or by the top-level "errors" key), but it doesn’t take advantage of GraphQL’s type system and can only express one error at a time.
    2. It works, but a stronger solution is to treat errors as data.
    3. In mutations, when errors happen, the other fields may return nil. So, if those other fields have null: false, but they return nil, the GraphQL will panic and remove the whole mutation from the response, including the errors!
    4. In order to have the rich error data, even when other fields are nil, those fields must have null: true so that the type system can be obeyed when errors happen.
    5. Then, client apps can show the error messages to end users, so they might correct the right fields in a form, for example.
    1. In general, top-level errors should only be used for exceptional circumstances when a developer should be made aware that the system had some kind of problem. For example, the GraphQL specification says that when a non-null field returns nil, an error should be added to the "errors" key. This kind of error is not recoverable by the client. Instead, something on the server should be fixed to handle this case. When you want to notify a client some kind of recoverable issue, consider making error messages part of the schema, for example, as in mutation errors.
    1. With GraphQL-Ruby, it’s possible to hide parts of your schema from some users. This isn’t exactly part of the GraphQL spec, but it’s roughly within the bounds of the spec.
    2. (Always call super to inherit the default behavior.)
    1. Authorization is the process of verifying that the current user has permission to do something (or see something), for example, checking admin? status or looking up permission groups from the database.
    2. Authentication is the process of determining what user is making the current request, for example, accepting a username and password, or finding a User in the database from session[:current_user_id].
    3. Instead, your controller should get the current user based on the HTTP request (eg, an HTTP header or a cookie) and provide that information to the GraphQL query.
    4. To illustrate the problem:
    5. However, this request-by-request mindset doesn’t map well to GraphQL because there’s only one controller and the requests that come to it may be very different.
    1. Unfortunately, many existing mechanisms to gauge and propagate trustworthiness—to work out if an interaction with a site is from a real human, for example—take advantage of techniques that can also be used for fingerprinting.
    2. Trust Tokens is a new API to help combat fraud and distinguish bots from real humans
    1. Use this to build a ClassAdder component. ClassAdder components are useful for reducing the size of your bundle. If you have tons of simple components that just need to add classes/props or set a context, using ClassAdder components means there's only one "big" Svelte component in your bundle for all of these many tiny components.
    2. This is useful when you need to add classes to a component, since Svelte's "class:" directives don't work on components.
    1. Persistent navigation drawers can toggle open or closed. The drawer sits on the same surface elevation as the content. It is closed by default and opens by selecting the menu icon, and stays open until closed by the user. The state of the drawer is remembered from action to action and session to session. When the drawer is outside of the page grid and opens, the drawer forces other content to change size and adapt to the smaller viewport.
    2. Temporary drawerTemporary navigation drawers can toggle open or closed. Closed by default, the drawer opens temporarily above all other content until a section is selected.
    1. As you read along, you’ll begin to notice UI designer is just another word for a foodie—we love to name our UI elements after food.
    2. These little trails of links help users figure out where they are within a website. Often located at the top of a site, breadcrumbs let users see their current location and the proceeding pages. Users are also able to click on them to move between steps.