183 Matching Annotations
  1. Last 7 days
  2. Dec 2023
  3. Oct 2023
    1. While the interface among services is HTTP, the networking is not. In fact, there is no networking! Unlike the typical “microservice architecture,” where services communicate over a network and can suffer from latency or interruption, service bindings are a zero-cost abstraction. When you deploy a service, we build a dependency graph of its service bindings, then package all of those services into a single deployment. When one service invokes another, there is no network delay; the request is executed immediately.This zero-cost model enables teams to share and reuse code within their organizations, without sacrificing latency or performance.
  4. Sep 2023
  5. Aug 2023
    1. ```toml type = "webpack" webpack_config = "webpack.config.js"

      these will be used in production

      vars = { WORKER_ENV = "production", SENTRY_ENABLED = true }

      [env.local]

      these will be used only when --env=local

      vars = { WORKER_ENV = "local", SENTRY_ENABLED = false } ```

      wrangler dev --env=local

    1. ```js // Auth Worker

      export default { async fetch(request, env) { // Read x-custom-token header and make sure it matches SECRET_TOKEN if (request.headers.get('x-custom-token') === env.SECRET_TOKEN) { return new Response('Request allowed', { status: 200 }); } else { return new Response('x-custom-token does not match, request not allowed', { status: 403 }); } }, }; ```

      ```js // Gateway Worker

      export default { async fetch(request, env) { // Fetch AUTH service and pass request const authResponse = await env.auth.fetch(request.clone());

      // Return response from the AUTH service if the response status is not 200
      // It would return 403 'x-custom-token does not match, request not allowed' response in such case
      if (authResponse.status !== 200) {
        return authResponse;
      }
      
      // Request allowed
      // You can write application logic here
      // In this case we delegate the logic to an `application` Worker
      return await env.application.fetch(request)
      

      }, }; ```

  6. Jul 2023
    1. The Hibernation API allows a Durable Object that is not currently running an event handler, such as handling a WebSocket message, HTTP request, or alarm, to be removed from memory while keeping its WebSockets connected (“hibernation”).
  7. Jun 2023
  8. May 2023
    1. Hey! Thanks for raising this. As pointed out earlier in the thread, the workerd npm distribution is currently incompatible with Debian 11 "Bullseye", so won't work with any distro based off that (e.g. Ubuntu 20.04). Debian 12 "Bookworm" based distros (e.g. Ubuntu 22.04) should work, provided you apt install libc++1. We're working on getting a statically linked version of workerd published that should work on older Linux versions. No timeline on when this will be available though.
    1. Figured it out. Cache-Control header is required.

      js const headers = { 'Cache-Control': 'public, max-age=604800' }; const request = new Request('https://foobar.com/') const cacheResponse = new Response('bar',{ headers }) const cache = caches.default await cache.put(request, cacheResponse) const response = await cache.match(request);

    1. 🥳

      ```js import { connect } from 'cloudflare:sockets';

      export default { async fetch(req: Request) { const gopherAddr = "gopher.floodgap.com:70"; const url = new URL(req.url);

      try {
        const socket = connect(gopherAddr);
      
        const writer = socket.writable.getWriter()
        const encoder = new TextEncoder();
        const encoded = encoder.encode(url.pathname + "\r\n");
        await writer.write(encoded);
      
        return new Response(socket.readable, { headers: { "Content-Type": "text/plain" } });
      } catch (error) {
        return new Response("Socket connection failed: " + error, { status: 500 });
      }
      

      } }; ts connect(address: SocketAddress | string, options?: SocketOptions): Socket

      declare interface Socket { get readable(): ReadableStream; get writable(): WritableStream; get closed(): Promise<void>; close(): Promise<void>; startTls(): Socket; }

      declare interface SocketOptions { secureTransport?: string; allowHalfOpen: boolean; }

      declare interface SocketAddress { hostname: string; port: number; } ```

  9. Apr 2023
    1. From this striving, otherwise than in the case of the intellectuals, there results also another statement of the problem, and new perspectives are opened. In this way conceptions are formed regarding the regulation of the mutual relations of human beings in social production, conceptions which to the intellectual elements appear incomprehensible and which they declare to be utopian and unrealizable. But these conceptions have already unfolded a powerful force in the revolutionary uprisings of the wage-workers, of the modern proletarians. This force was shown first on a major scale in the Paris Commune, which sought to overcome the centralized authority of the State through the self-administration of the communes. It was the cause also of Marx’s giving up his idea (expressed in the Communist Manifesto) that state economy would lead to the disappearance of class society. In the workers’ and soldiers’ councils of the Russian and German revolutions of 1917-23, it arose once more to a mighty and at times all-mastering power. And in future no proletarian-revolutionary movement is conceivable in which it will not play a more and more prominent and finally all-mastering role. It is the self-activity of the broad working masses which manifests itself in the workers’ councils. Here is nothing utopian any longer; it is actual reality. In the workers’ councils the proletariat has shaped the organizational form in which it conducts its struggle for liberation.
    1. Nonetheless, there remains still an unbalanced contradiction between on one hand Marx's characterization of the Paris Commune as the finally discovered "political form" for accomplishing the economic and social self-liberation of the working class and, on the other hand, his emphasis at the same time that the suitability of the commune for this purpose rests mainly on its formlessness; that is, on its indeterminateness and openness to multiple interpretations. It appears there is only one point at which Marx's position is perfectly clear and to which he professed at this time under the influence of certain political theories he had in the meantime come up against and which were incorporated in this original political concept-and not least under the practical impression of the enormous experience of the Paris Commune itself. While in the Communist Manifesto of 1847-48 and likewise in the Inaugural Address to the International Workers' Association in 1864, he still had only spoken of the necessity “for the proletariat to conquer political power” now the experiences of the Paris Commune provided him with the proof that "the working class can not simply appropriate the ready-made state machinery and put it into motion for its own purposes, but it must smash the existing bourgeois state machinery in a revolutionary way." This sentence has since been regarded as an essential main proposition and core of the whole political theory of Marxism, especially since in 1917 Lenin at once theoretically restored the unadulterated Marxian theory of the state in his work "State and Revolution" and practically realized it through carrying through the October Revolution as its executor. But obviously nothing positive is at all yet said about the formal character of the new revolutionary supreme state power of the proletariat with the merely negative determination that the state power cannot simply "appropriate the state machinery" of the previous bourgeois state "for the working class and set it in motion for their own purposes." So we must ask: for which reasons does the "Commune" in its particular, determinate form represent the finally discovered political form of government for the working class, as Marx puts it in his Civil War, and as Engels characterizes it once more at great length in his introduction to the third edition of the Civil War twenty years later? Whatever gave Marx and Engels, those fiery admirers of the centralized system of revolutionary bourgeois dictatorship realized by the great French Revolution, the idea to regard precisely the "Commune" as the "political form" of the revolutionary dictatorship of the proletariat, when it appeared to be the complete opposite to that system?
  10. Mar 2023
    1. HTML templating and streaming response library for Worker Runtimes such as Cloudflare Workers.

      js function handleRequest(event: FetchEvent) { return new HTMLResponse(pageLayout('Hello World!', html` <h1>Hello World!</h1> ${async () => { const timeStamp = new Date( await fetch('https://time.api/now').then(r => r.text()) ); return html`<p>The current time is ${timeEl(timeStamp)}.</p>` }} `)); }

  11. Feb 2023
    1. ```js import type { EntryContext } from "@remix-run/cloudflare"; import { RemixServer } from "@remix-run/react"; import isbot from "isbot"; import { renderToReadableStream } from "react-dom/server";

      const ABORT_DELAY = 5000;

      const handleRequest = async ( request: Request, responseStatusCode: number, responseHeaders: Headers, remixContext: EntryContext ) => { let didError = false;

      const stream = await renderToReadableStream( <RemixServer context={remixContext} url={request.url} abortDelay={ABORT_DELAY} />, { onError: (error: unknown) => { didError = true; console.error(error);

          // You can also log crash/error report
        },
        signal: AbortSignal.timeout(ABORT_DELAY),
      }
      

      );

      if (isbot(request.headers.get("user-agent"))) { await stream.allReady; }

      responseHeaders.set("Content-Type", "text/html"); return new Response(stream, { headers: responseHeaders, status: didError ? 500 : responseStatusCode, }); };

      export default handleRequest; ```

  12. Jan 2023
  13. Dec 2022
  14. Nov 2022
    1. He has a warehouse of notecards with ideas and stories and quotes and facts and bits of research, which get pulled and pieced together then proofread and revised and trimmed and inspected and packaged and then shipped.

      While the ancients thought of the commonplace as a storehouse of value or a treasury, modern knowledge workers and content creators might analogize it to a factory where one stores up ideas in a warehouse space where they can be easily accessed, put into a production line where those ideas can be assembled, revised, proofread, and then package and distributed to consumers (readers).

      (summary)

  15. Oct 2022
    1. The reason theytreasure their smallest experiences is because, in thecourse of a lifetime, a modem man has so very littlepersonal experience, and yet experience is so important asa source of good intellectual work.

      The antecedent for "they" here is "accomplished thinkers".

    2. whether he knows it or not, the intellec-tual workman forms his own self as he works towards theperfection of his craft.

      Here Mills seems to be defining (in 1952) an "intellectual workman" as an academic, but he doesn't go as broad as a more modern "knowledge worker" (2022) which includes those who broadly do thinking in industry as well as in academia. His older phrase also has a more gendered flavor to it that knowledge worker doesn't have now.

  16. Sep 2022
  17. Aug 2022
  18. Jul 2022
    1. Many of the workers reported that first thing in themorning, or after any interruption in their thought(like a ‘phone call), they have the “where was 1?”problem in a complex and ill-defined space of ideas.The layout of physical materials on their desk givesthem powerful and immediate contextual cues torecover a complex set of threads without difilcultyand delay, “this is my whole context, these are mypersonal piles”

      Following interruptions by colleagues or phone calls at work, people may frequently ask themselves "where was I?" more frequently than "what was I doing?" This colloquialism isn't surprising as our memories for visual items and location are much stronger than actions. Knowledge workers will look around at their environments for contextual clues for what they were doing and find them in piles of paper on their desks, tabs in their computer browser, or even documents (physical or virtual) on their desktops.

    2. Mander, R., Salomon, G. and Wong, Y. A PileMetaphor for Supporting Casual Organisationof Information. Proceedings of Human Factorsin Computing Systems CHI’92, pp 627-634,1992.

      The quote from this paper references Mander 1992:

      It seems that knowledge workers use physical space, such as desks or floors, as a temporary holding pattern for inputs and ideas which they cannot yet categorise or even decide how they might use [12].

      leads me to believe that the original paper has information which supports office workers using their physical environments as thinking and memory spaces much as indigenous peoples have for their knowledge management systems using orality and memory.

    3. Many knowledge workers have extremely cluttereddesks and floors and yet are seriously disrupted bychanges made to this apparent “muddle” or byneeding to move offices regularly. This supportsearlier studies of otllce work [10, 11]. It seems thatthis apparent “muddle” plays a number of importantroles for them in their work:-

      For scholars of orality, the value of the messiness in many knowledge workers' work spaces is probably not surprising. It's likely that these workers are using their local environment as oral cultures have since time immemorial. They're creating physical songlines or memory palaces in their local environment to which they're spatially attaching memories of the work they're doing, performing, or need to perform. This allows them to offload some of their memory work, storage, and retention to items in their physical space.

    4. Unfortunately, many corporate software programsaim to level or standardise the differences betweenindividual workers. In supporting knowledgeworkers, we should be careful to provide tools whichenable diversification of individuals’ outputs.Word-processors satisfi this criterion; tools whichembed a model of a knowledge worker’s task in thesoftware do not.

      Tools which allow for flexibility and creativity are better for knowledge workers than those which attempt to crystalize their tasks into ruts. This may tend to force the outputs in a programmatic way and thereby dramatically decrease the potential for innovative outputs. If the tools force the automation of thought without a concurrent increase in creativity then one may as well rely on manual labor for their thinking.


      This may be one of the major flaws of tools for thought in the educational technology space. They often attempt to facilitate the delivery of education in an automated way which dramatically decreases the creativity of the students and the value of the overall outputs. While attempting to automate education may suit the needs of institutions which are delivering the education, particularly with respect to the overall cost of delivery, the automation itself is dramatically at odds with the desire to expand upon ideas and continue innovation for all participants involved. Students also require diverse modes of input (seen/heard) as well as internal processing followed by subsequent outputs (written/drawn/sculpted/painted, spoken/sung, movement/dance). Many teachers don't excel at providing all of these neurodiverse modes and most educational technology tools are even less flexible, thus requiring an even larger panoply of them (often not interoperable because of corporate siloing for competitive reasons) to provide reasonable replacements. Given their ultimate costs, providing a variety of these tools may only serve to increase the overall costs of delivering education or risk diminishing the overall quality. Educators and institutions not watching out for these traps will tend to serve only a small portion of their intended audiences, and even those may be served poorly as they only receive a limited variety of modalities of inputs and outputs. As an example Western cultures' overreliance on primary literacy modes is their Achilles' heel.


      Tools for thought should actively attempt to increase the potential solution spaces available to their users, while later still allowing for focusing of attention. How can we better allow for the divergence of ideas and later convergence? Better, how might we allow for regular and repeated cycles of divergence and convergence? Advanced zettelkasten note taking techniques (which also allow for drawing, visual, auditory and other modalities beyond just basic literacy) seem to allow for this sort of practice over long periods of time, particularly when coupled with outputs which are then published for public consumption and divergence/convergence cycles by others.

      This may also point out some of the stagnation allowed by social media whose primary modes is neither convergence nor divergence. While they allow for the transmission/communication portion, they primarily don't actively encourage their users to closely evaluate the transmitted ideas, internalize them, or ultimately expand upon them. Their primary mode is for maximizing on time of attention (including base emotions including excitement and fear) and the lowest levels of interaction and engagement (likes, retweets, short gut reaction commentary).

    5. the definingcharacteristic of knowledge workers is that they arethemselves changed by the information theyprocess.’ So, the workers interviewed saw theirvalue to an organisation being to understand a bodyof knowledge and generate new information fromthis understanding which changed either theorganisation or its customer in a direct way.

      a more refined and nuanced definition of knowledge workers than Peter Drucker's 1973 definition.

    6. I thereforeidentified twelve knowledge workers in a range ofU. S, and European companies, Their job functionsincluded: design, advertising, marketing,management consultancy, broadcasting, law, financeand research.

      Areas of knowledge work (as determined in 1994 at least) included design, advertising, marketing, management consultancy, broadcasting, law, finance, and research.

    7. In the rest of this section, wherever I say “knowledge worker”, I strictly mean only the small set I sampled.

      CAUTION!

      Built in assumptions which may not extrapolate.


      This caveat is also a strong indication of the state-of-the-art of the level of knowledge worker research in 1994.

    8. Peter Drucker, the distinguished commentator onorganisation and management, has popularised theterm “knowledge worker” to describe the role of agrowing percentage of employees in businessorganisations: “The manual worker is yesterday..,..The basic capital resource, the fundamentalinvestment, but also the cost centre for a developedeconomy is the knowledge worker who puts to work

      what he has learned in systematic education, that is, concepts, ideas and theories, rather than the man who puts to work manual skill or muscle, ” [5]. 5. Drucker, P. F. Management: Tasks, Responsibilities and Practices, Harper & Row; New York, 1973.

      Influential management consultant, educator, and author Peter Drucker helped to popularize the concept of the "knowledge worker" by way of his book Management: Tasks, Responsibilities and Practices (Harper & Row, 1973).


      Who/where is the origin of the neologism/idea of "knowledge worker"?

  19. Jun 2022
    1. Weber left home and lived in poverty while working as a street-corner evangelist and social activist for two years with the evangelical Church Army Workers, an organization similar to the Salvation Army, preaching and singing hymns on street corners and singing and playing the organ in rescue missions in red-light districts in Pittsburgh and New York,[13][33] until the Church Army Workers disbanded in 1900.

      This is interesting background given her subsequent blockbuster film Where are My Children? (Universal Studios, 1916) which covered abortion and birth control.

      https://en.wikipedia.org/wiki/Lois_Weber

    1. The Essential Habits ofDigital Organizers

      This chapter is too entailed with productivity advice, which can be useful to some, but isn't as note taking focused for those who probably need more of that.

      What is the differentiator between knowledge workers, knowledge creators, students, researchers, academics. How do we even clearly delineate knowledge worker as a concept. It feels far too nebulous which makes it more difficult to differentiate systems for them to use for improving productivity and efficiency.

  20. May 2022
  21. Apr 2022
    1. Eric Topol. (2021, April 23). Just published @TheLancet: Effect of vaccine in >23,000 health care workers https://t.co/ohy3VyHM3C Dose response: No vaccine 977 infections; 1 dose 71 infections; 2 doses 9 infections (14|8|4 per 10,000 person-days) "can prevent both symptomatic and asymptomatic infection " https://t.co/EybVBFmXrU [Tweet]. @EricTopol. https://twitter.com/EricTopol/status/1385729322472730626

    1. Kamlesh Khunti. (2021, February 14). Our pre-print publication on #COVIDVaccine hesitancy in health care workers. Vaccination rates: White 70% South Asian 59% Black 37% ⬆️ rates in Allied HCPs & administrative/exe staff vs Drs Urgently need to identify barriers & overcome these https://t.co/hBYJFCBzyi https://t.co/OLeNZrswcN [Tweet]. @kamleshkhunti. https://twitter.com/kamleshkhunti/status/1360926907978682372

    1. Cache using fetch

      Determine how to cache a resource by setting TTLs, custom cache keys, and cache headers in a fetch request.

      ```js async function handleRequest(request) { const url = new URL(request.url);

      // Only use the path for the cache key, removing query strings // and always store using HTTPS, for example, https://www.example.com/file-uri-here const someCustomKey = https://${url.hostname}${url.pathname};

      let response = await fetch(request, { cf: { // Always cache this fetch regardless of content type // for a max of 5 seconds before revalidating the resource cacheTtl: 5, cacheEverything: true, //Enterprise only feature, see Cache API for other plans cacheKey: someCustomKey, }, }); // Reconstruct the Response object to make its headers mutable. response = new Response(response.body, response);

      // Set cache control headers to cache on browser for 25 minutes response.headers.set('Cache-Control', 'max-age=1500'); return response; }

      addEventListener('fetch', event => { return event.respondWith(handleRequest(event.request)); }); ```


      Caching HTML resources

      Setting the cache level to Cache Everything will override the default cacheability of the asset. For time-to-live (TTL), Cloudflare will still rely on headers set by the origin.

      js // Force Cloudflare to cache an asset fetch(event.request, { cf: { cacheEverything: true } });

  22. Mar 2022