89 Matching Annotations
  1. Nov 2023
    1. @tmoschou You can find the source for Apple's pkill on opensource.apple.com/source. It's together with other utilities in the collection adv_cmds. Maybe you can spot the bug.
  2. Jan 2023
  3. Nov 2022
    1. You can also go to the Ruby OAuth Client Library to download the source code and run: 1gem build intuit-oauth.gemspec to build your own gem if you want to modify certain functions in the library.
  4. Sep 2022
    1. In collusion, writing good code not only require knowledge but also require compassion. To understand people's pain and mistakes, to think about your teammate and to help everyone achieve a better life.
    2. Think about how good it is if you can build a system at “2 half brain quality” and then people just need use 1 half of their brain to maintain it. You can fix bug in a blink of an eye, run tests and give it to tester, done. Everything will be done in a easiest way and fixing bug or refactoring can be easy like breathing. The most heavy task in programming is not about building application, but it’s about maintain them and if you wrote something you can’t understand, then you will suffer for the rest of your life.
    1. your cognitive load increases with the level of indentation. 1 2 3 4 5 6 7 8 9 10 if r.Method == "GET" { if r.Header.Get("X-API-KEY") == key { // ok return nil }else{ return errors.New("Key is not valid") } } else { return errors.New("Invalid Method") }
    2. Avoid indentation levels, If you find yourself with more than 3, you should create a function.
    3. Code explains what and how Documentation explains why.
    4. Do you really need those lines? Isn’t it clear enough? Well, I still find comments like this in a lot of cases and it gets funnier when the comment is obsolete and the code is doing other things. Following the example, let’s imagine that another developer adds support for PUT method. I think that this is what would happen.
  5. Aug 2022
    1. This describes one of the most pleasing hacks I've ever come across. I just now tracked it down and added it to my bookmarks. (Not sure why it wasn't already there.)

      You could also conceive of going one step further. When your app (doesn't actually have to be a game, though admittedly it's much easier for you if it is) is compiled with tweak.h, it gives it the power to paint the source file on the screen—so you don't actually have to switch over to your text editor to save it, etc. Suppose you want to provide custom inputs like Bret Victor-style sliders for numeric values. You could edit it in your text editor, or you could derp around with it in-app. Tweaking the value in-app should of course both update it wrt the app runtime but also still write the file to disk, too, so if live reloading is turned on in your text editor, whatever changes you make inside the live process image gets synced out.

  6. Apr 2022
  7. Mar 2022
  8. Dec 2021
  9. Nov 2021
  10. Jun 2021
  11. May 2021
    1. You can see the implementation here: https://github.com/sveltejs/sapper/blob/339c417b24e8429d3adc9c9f196bf159a5fce874/runtime/src/server/middleware/get_page_handler.ts#L137
  12. Apr 2021
    1. :structured - Lumberjack::Formatter::StructuredFormatter - crawls the object and applies the formatter recursively to Enumerable objects found in it (arrays, hashes, etc.).
  13. Mar 2021
    1. This is not a fork. This is a repository of scripts to automatically build Microsoft's vscode repository into freely-licensed binaries with a community-driven default configuration.

      almost without a doubt, inspired by: chromium vs. chrome

    1. here is my set of best practices.I review libraries before adding them to my project. This involves skimming the code or reading it in its entirety if short, skimming the list of its dependencies, and making some quality judgements on liveliness, reliability, and maintainability in case I need to fix things myself. Note that length isn't a factor on its own, but may figure into some of these other estimates. I have on occasion pasted short modules directly into my code because I didn't think their recursive dependencies were justified.I then pin the library version and all of its dependencies with npm-shrinkwrap.Periodically, or when I need specific changes, I use npm-check to review updates. Here, I actually do look at all the changes since my pinned version, through a combination of change and commit logs. I make the call on whether the fixes and improvements outweigh the risk of updating; usually the changes are trivial and the answer is yes, so I update, shrinkwrap, skim the diff, done.I prefer not to pull in dependencies at deploy time, since I don't need the headache of github or npm being down when I need to deploy, and production machines may not have external internet access, let alone toolchains for compiling binary modules. Npm-pack followed by npm-install of the tarball is your friend here, and gets you pretty close to 100% reproducible deploys and rollbacks.This list intentionally has lots of judgement calls and few absolute rules. I don't follow all of them for all of my projects, but it is what I would consider a reasonable process for things that matter.
    1. If you don't mind putting the sourcemap url in the minified JS
    2. While I understand orgs wanting not to expose their unminified source, it's security through obscurity (meaning it's not adding any real security).
    3. The only place I can find it is in the sprockets-rails gem. javascript_include_tag calls this: def find_debug_asset(path) if asset = find_asset(path, pipeline: :debug) raise_unless_precompiled_asset asset.logical_path.sub('.debug', '') asset end end
  14. Feb 2021
    1. note that TRB source code modifications are not proprietary

      In other words, you can build on this software in your proprietary software but can't change the Trailblazer source unless you're willing to contribute it back.

      loophole: I wonder if this will actually just push people to move their code -- which at the core is/would be a direction modification to the source code - out to a separate module. That's so easy to do with Ruby, so this restriction hardly seems like it would have any effect on encouraging contributions.

  15. Jan 2021
  16. Dec 2020
    1. Treating the web as a compile target has a lot of implications, many negative. For example “view source” is a beloved feature of the web that’s an important part of its history and especially useful for learning, but Svelte’s compiled output is much harder to follow than its source. Source maps, which Svelte uses to map its web language outputs back to its source language, have limitations.
  17. Nov 2020
    1. they're in the svelte compiler: https://github.com/sveltejs/svelte/blob/master/src/compiler/compile/nodes/Element.ts#L668 (search for the warning text)
  18. Oct 2020
  19. Sep 2020
  20. Aug 2020
  21. May 2020
    1. export DOCKER_TLS_VERIFY=1 export DOCKER_CERT_PATH="$DOCKER_TLS_CERTDIR/client"
    2. if [ -z "${DOCKER_HOST:-}" ]; then if _should_tls || [ -n "${DOCKER_TLS_VERIFY:-}" ]; then export DOCKER_HOST='tcp://docker:2376' else export DOCKER_HOST='tcp://docker:2375' fi fi
    1. if [ -n "${DOCKER_HOST:-}" ] && _should_tls; then export DOCKER_TLS_VERIFY=1 export DOCKER_CERT_PATH="$DOCKER_TLS_CERTDIR/client" fi
    2. if [ -z "${DOCKER_HOST:-}" ] && [ ! -S /var/run/docker.sock ]; then if _should_tls || [ -n "${DOCKER_TLS_VERIFY:-}" ]; then export DOCKER_HOST='tcp://docker:2376' else export DOCKER_HOST='tcp://docker:2375' fi fi
    1. Docker 19.03 does this automatically # by setting the DOCKER_HOST in # https://github.com/docker-library/docker/blob/d45051476babc297257df490d22cbd806f1b11e4/19.03/docker-entrypoint.sh#L23-L29
    1. Code Owners allows for a version controlled single source of truth file outlining the exact GitLab users or groups that own certain files or paths in a repository.
    1. Add-ons are not allowed to contain obfuscated code, nor code that hides the purpose of the functionality involved. If external resources are used in combination with add-on code, the functionality of the code must not be obscured.
    1. Mozilla can still block distribution of the extension, even when not distributed via ADO. It is not possible for us to provide Mozilla the unminified JavaScript source files for Google’s and Microsoft’s translation widgets. This is a risk because Mozilla can demand such.
    2. Mozilla does not permit extensions distributed through https://addons.mozilla.org/ to load external scripts. Mozilla does allow extensions to be externally distributed, but https://addons.mozilla.org/ is how most people discover extensions. The are still concerns: Google and Microsoft do not grant permission for others to distribute their "widget" scripts. Google's and Microsoft's "widget" scripts are minified. This prevents Mozilla's reviewers from being able to easily evaluate the code that is being distributed. Mozilla can reject an extension for this. Even if an extension author self-distributes, Mozilla can request the source code for the extension and halt its distribution for the same reason.

      Maybe not technically a catch-22/chicken-and-egg problem, but what is a better name for this logical/dependency problem?

  22. Apr 2020
  23. Mar 2020
  24. Feb 2020
    1. We believe load test scripts should be plain code to get all the benefits of version control, as opposed to say unreadable and tool generated XML.

      Saw another comment lamenting the use of ugly/unreasonable XML files:

      https://github.com/flood-io/ruby-jmeter

      Tired of using the JMeter GUI or looking at hairy XML files?

  25. Jan 2020
    1. I was going through the source for Thin and noticed that instead of using require, Marc-Andre Cournoyer was using a method called autoload to load thin's constituent parts.
  26. Dec 2019
  27. Nov 2019
    1. the main reason we built a new multiprocess architecture is that Chromium's multiprocess support was never contributed to the WebKit project. It has always lived in the separate Chromium tree, making it pretty hard to use for non-Chrome purposes.Before we wrote a single line of what would become WebKit2 we directly asked Google folks if they would be willing to contribute their multiprocess support back to WebKit, so that we could build on it. They said no.
  28. Sep 2019
  29. Feb 2019
  30. Mar 2018
    1. export var Layer = Evented.extend({

      Layer is the base class for geometry object in Leaflet.

      • base class for Marker
      • base class for Vector objects (path, polyline, polygon, circle, rectangle)
      • base class for tile layers
    1. // Adds the given layer to the group.

      addLayer method add object to LayerGroup. Since Path is extend from Layer. Almost all geometry can be applied here.

      • marker
      • path/circle/ployline/polygon
  31. Dec 2016
    1. Fact-based journalism now competes with false information for our attention while our cities and citizens become both more connected by technology and more divided by ideology and income. The values reflected in lines of code, whether it be at the ATM, when we search on internet or drive a car, are already affecting what we think, what we do and what information we share with those around us.
  32. Nov 2016