631 Matching Annotations
  1. Jan 2023
  2. Nov 2022
  3. Oct 2022
    1. You may need pathname2url

      (Author:: [[neurino on Stack Overflow]]) python from urllib.request import pathname2url pathname2url('dir/foo, bar.mp3')

  4. Sep 2022
    1. But, traditionally, en dashes function as a kind of super hyphen. They’re meant to give you a little extra glue when you have a compound modifier that includes a multi-word element that can’t easily be hyphenated.

      “Elvis Presley–style”

      [[Angela Gibson - Hyphens and en Dashes the MLA Way (Highlights)#^388615797|MLA only uses en dashes when a single compound adjective is a proper noun]], e.g., “pre–Industrial Revolution city”.

    2. You can use a pair of em dashes to draw special attention to parenthetical information

      Like () but stronger.

      Example: The new nurse—who was wearing the same purple scrubs as the old nurse—entered the room with a tray of Jello.

    3. When to use em dashes

      .h1

    4. When to use en dashes

      .h1

    5. You should also use a hyphen with a compound modifier before a noun. A compound modifier (also called a phrasal adjective) is made up of two or more words that must be understood as a unit.

      “a dog-friendly hotel”

    6. When to use hyphens

      .h1

    1. by Angela Gibson

    2. We do, however, use an en dash when a single compound adjective is a proper noun

      pre–Industrial Revolution city

    3. The MLA does not use an en dash for compound adjectives formed from lowercase open compounds and another word. Instead, we hyphen the entire compound

      civil rights legislation → post-civil-rights legislation

      (not post–civil rights legislation)

    1. rampion on Stack Overflow & daotoad on Stack Overflow

    2. This runs the global command to yank any line that matches ^match and put it in register a. Because a is uppercase, instead of just setting the register to the value, it will append to it.

      :g/^match/yank A

    1. To stick with the theme of consistency, if you want to use your coding font on GitHub to make code reviews feel closer to what they look like in your text editor, drop this into Refined GitHub’s Custom CSS extension settings

      .code code css code, kbd, pre, tt, .ace_editor.ace-github-light, .blame-sha, .blob-code-inner, .blob-num, .branch-name, .commit .sha, .commit .sha-block, .commit-desc pre, .commit-ref, .commit-tease-sha, .default-label .sha, .export-phrase pre, .file-editor-textarea, .file-info, .gollum-editor .expanded textarea, .gollum-editor .gollum-editor-body, .hook-delivery-guid, .hook-delivery-response-status, .input-monospace, .news .alert .branch-link, .oauth-app-info-container dl.keys dd, .quick-pull-choice .new-branch-name-input input, .tag-references > li.commit, .two-factor-secret, .upload-files .filename, .url-field, .wiki-wrapper .wiki-history .commit-meta code { font-family: 'Fira Code' !important; }

  5. Jul 2022
    1. bitcoin-cli decodepsbt

      .code code json { "tx": { "txid": "33a316d62ddf74656967754d26ea83a3cb89e03ae44578d965156d4b71b1fce7", "hash": "33a316d62ddf74656967754d26ea83a3cb89e03ae44578d965156d4b71b1fce7", "version": 2, "size": 113, "vsize": 113, "weight": 452, "locktime": 0, "vin": [ { "txid": "f8efa583e93ab71debe62a5374f91563aa10a3461518042aaddb464b656350e2", "vout": 1, "scriptSig": { "asm": "", "hex": "" }, "sequence": 4294967295 } ], "vout": [ { "value": 0.17977676, "n": 0, "scriptPubKey": { "asm": "0 bfaa5381b28737ad0267e4509f9c8eb87e9cd968", "hex": "0014bfaa5381b28737ad0267e4509f9c8eb87e9cd968", "reqSigs": 1, "type": "witness_v0_keyhash", "addresses": [ "bcrt1qh7498qdjsum66qn8u3gfl8ywhplfektg6mutfs" ] } }, { "value": 0.50000000, "n": 1, "scriptPubKey": { "asm": "0 90db38553413acc517f33e83f00a0f2a88da251a", "hex": "001490db38553413acc517f33e83f00a0f2a88da251a", "reqSigs": 1, "type": "witness_v0_keyhash", "addresses": [ "bcrt1qjrdns4f5zwkv29ln86plqzs092yd5fg6nsz8re" ] } } ] }, "unknown": { }, "inputs": [ { "witness_utxo": { ... }, "non_witness_utxo": { ... }, "sighash": "ALL" } ], "outputs": [ ... ], "fee": 0.00007050 }

  6. May 2022
    1. If the new state is computed using the previous state, you can pass a function to setState

      Useful to not depend on a stalled state captured by the closure.

  7. Apr 2022
    1. Here is an example of what a .gitpod.yml with installed extensions may look like:

      code

      yaml vscode: extensions: - svelte.svelte-vscode - bradlc.vscode-tailwindcss@0.6.11 - https://example.com/abc/releases/extension-0.26.0.vsix

    1. Ongoing maintenance and continued development could be similarly incentivized, with digital asset-based incentives being awarded automatically based on performance metrics established by the DAO. One example of this in DeFi is Liquity Protocol
    2. I welcome you to read the full piece below; read the more comprehensive paper that this piece is based on
    1. This clears all defined shortcuts for those tasks. And then just use 'Settings-->Keyboard-->Shortcuts-->Navigation' to define the desired shortcuts.

      bash gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left "['']" gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right "['']"

    1. You can always get the error object inside the component reactively. But in case you want to handle the error globally, to notify the UI to show a toast or a snackbar, or report it somewhere such as Sentry, there's an onError event

      jsx <SWRConfig value={{ onError: (error, key) => { if (error.status !== 403 && error.status !== 404) { // We can send the error to Sentry, // or show a notification UI. } } }}> <MyApp /> </SWRConfig>

    1. Support branches are not really covered in GitFlow, but are essential if you need to maintain multiple major versions at the same time. You could use support branches for supporting minor releases as well.

      ArSsHa

    1. For all other cases, such as <title> tags, we recommend using next/head in your pages or components.

      When using title here, the production build will append weird <!-- -->. See solution here.

    2. To override the default Document, create the file pages/_document.js as shown below:

      ```jsx import { Html, Head, Main, NextScript } from 'next/document'

      export default function Document() { return ( <Html> <Head /> <body> <Main /> <NextScript /> </body> </Html> ) } ```

    1. iBooks 和 Kindle这些阅读平台都是不能直接读 TXT 文件的。如果不通过 Calibre,而是用通过在邮件标题加入「convert」给 Kindle 文件自动转换,但是最后的效果……实在是一言难尽。稍微调整一下 Calibre 自带的设置,导出的效果就会好很多。我用到的设置有这些,都可以在转换页面里面找到

      字体页

      • 最小行高 140%

      布局页

      • 缩进宽度 2.0 em
      • 行间距 0.5 em

      样式页

      css h2 {text-align: center; padding-top: 30pt; padding bottom: 25pt;} h3 {text-align: center; } h4 {text-align: center; }

    1. URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

      Query first, then fragment

    1. The errorformat option needs to be set for cgetbuf to work properly. So in ~/.vim/ftplugin/qf.vim OR ~/.vim/after/ftplugin/qf.vim add the following line

      code

      setlocal errorformat=%f\|%l\ col\ %c\|%m

    1. git diff -- . ':(exclude)db/irrelevant.php' ':(exclude)db/irrelevant2.php'

      ! is a shortcut of (exclude).

      Link to the answer

    1. In case you’re interested in understanding how to safely implement a future combinator function using stack pinning yourself, take a look at the relatively short source of the map combinator method of the futures crate and the section about projections and structural pinning of the pin documentation.
    1. Recommended follow-up: Read Designing Distributed Systems (book) Read Distributed Systems Observability (report) Watch Distributed Systems in One Lesson (video) Read Distributed Tracing in Practice (book) Take Design Patterns for Distributed Systems (live online training course with Priyank Gupta)

      Recommended follow-up:

    1. Create a new directory ~/.local/share/fonts/<font-family-name>/ for the new font family mkdir -p ~/.local/share/fonts/robofont Copy font files (e.g. .ttf files) to the new directory cp ~/Downloads/robofont.ttf ~/.local/share/fonts/robofont Update the font cache fc-cache -v

      Code

      mkdir -p ~/.local/share/fonts/robofont cp ~/Downloads/robofont.ttf ~/.local/share/fonts/robofont fc-cache -v

    1. So I want to tell you what my three buckets are where I derive my models, my multidisciplinary models.

      See problems from different perspectives and at different levels.

    2. Filled up three big binders. And for the next six months I went to the coffee shop for an hour or two every morning and I read these. And I read them index fund style, which means I read them all.

      Explore the delve into.

    1. data:text/html;charset=utf-8,%3Chtml%3E%3Ctitle%3EColor Picker%3C%2Ftitle%3E%3Cinput type%3D"color"%3E%3C%2Fhtml%3E

      .code

    2. javascript: document.querySelectorAll("SELECTOR").forEach(element => element.classList.toggle("CLASS"));

      .code

    3. Manually writing expires= dates for cookies is awkward as heck, but luckily this create-your-own-set-cookie-bookmarklet app can generate a bookmarklet for a specific cookie, if you know its exact name.
    4. javascript: document.querySelector("SELECTOR").click();

      .code

    5. javascript: document.querySelectorAll("*").forEach(element => element.style.background="rgb(0 0 0 / 10%)");

      .code

    6. Color widget bookmark

      .h1

    7. Toggling classes

      .h1

    8. Setting cookies

      .h1

    9. Simulating events

      .h1

    10. Applying a background to everything

      .h1

    11. Activating design mode

      .h1

    1. Tactic 6: Follow Up (No one does this!)

      .h1

    2. Tactic 5: End Gracefully

      .h1

    3. Tactic 4: Find Common Ground

      .h1

    4. Tactic 3: Give Genuine Gratitude

      .h1

    5. Tactic 2: Ask Questions (How to Approach a Group)

      .h1

    6. Tactic 1: Smile and Say Hi

      .h1

    7. Core Philosophy 3: Don't Overthink - Be Genuine & Have Fun

      .h1

    8. Core Philosophy 2: Give First, then Give Some More

      .h1

    9. Core Philosophy 1: Make Other People Feel Welcome and Accepted

      .h1

    1. Croot introduced powerful new methods from harmonic analysis — a branch of math closely related to calculus — to confirm the Erdős-Graham prediction. His paper was published in the Annals of Mathematics, the top journal in the field.
  8. Mar 2022
    1. 3. How to Remember More of What You’ve Learned

      .h1

    2. 2. How to Learn Better (with Science)

      .h1

    3. Take a page from the project management playbook and schedule it

      .h2

    4. Do your research first

      .h2

      Survey and compile a list of resources.

    5. 1. How to Start Your Ultralearning Project

      .h1

    1. The total amount of money lost by blockchain hackers is about $ 25,295,753,270.63 Total hack events 662

      A list of known blockchain hack events.

    1. Holochain is an open-source framework for developing microservices that run peer-to-peer applications entirely on end-user devices without central servers.
    1. The Five Principles of Deliberate Practice
    2. Why Do We Need Deliberate Practice?
    3. That’s why the famous quote by Henry Ford is so famous, “Whether you think you can, or you think you can’t – you’re right.”
    4. Why is Deliberate Practice Important To Get?
    5. What is Deliberate Practice?
    1. At the moment the link will not show, to ensure that it can be seen, locate the text ?dl=0 within the URL and change it to raw=1:

      .qa How to host an image using Dropbox? Replace dl=0 with raw=1 in the created link.

    1. Linggle
    2. Ludwig
    3. 第二种是A vs B 语法,可以对比词频。

      Ludwig

    4. 全名 Ludwig.guru ,我认为它最大的优点,是语料来源全部精选过,靠谱,不用我再去筛选例句是哪里来的。
    1. 通过导入注册表的方式来快捷添加。

      .code

      ``` Windows Registry Editor Version 5.00

      [HKEY_CURRENT_USER\Software\Microsoft\InputMethod\Settings\CHS] "Enable Cloud Candidate"=dword:00000000 "Enable Dynamic Candidate Ranking"=dword:00000001 "EnableExtraDomainType"=dword:00000001 "Enable self-learning"=dword:00000001 "EnableSmartSelfLearning"=dword:00000001 "EnableLiveSticker"=dword:00000000 "Enable EUDP"=dword:00000001 "Enable Double Pinyin"=dword:00000001 "UserDefinedDoublePinyinScheme0"="小鹤双拼2^*iuvdjhcwfg^xmlnpbksqszxkrltvyovt" "DoublePinyinScheme"=dword:0000000a ```

    1. Use sub-groups to identify what tasks have and haven’t been reviewed. 

      Section in Todoist

  9. Feb 2022
  10. Sep 2021
    1. ▋当观念之争遭遇“政治正确VS正确”
    2. ▋辩论三:意识形态与宗教
    3. ▋辩论二:平等神话,分配正义与共富
    4. ▋辩论一:计划经济与市场经济
  11. Aug 2021
    1. 8. Forgive yourself
    2. 7. Use a timer
    3. 6. Let yourself avoid uncomfortable tasks
    4. 5. Reframe your task and its deadline
    5. 4. Imagine the future
    6. 3. Ask for help
    7. SHARE I’ve read all the articles and listened to all the podcasts about procrastination. I’ve tried all the tricks—including literally trying to trick myself.Sometimes hacks work. Sometimes an article about how bad a habit procrastination is will kick me into gear and help me get things done early for a change.But it never lasts. I’ve never fully kicked procrastination to the curb. Even when I’m on a productive bent, I’m still a procrastinator at heart.When I’d just about given up on ever curing my bad habit, I came across a theory of procrastination I’d never heard of, and it completely changed the way I think about procrastination.The truth is, procrastination is more about our emotions than our tendencies for laziness or just being “bad at deadlines”.  At its core, we procrastinate to keep ourselves happy in the moment —which makes complete sense, right? That is, until we’re pulling an all-nighter to meet that client deadline we had weeks to prepare for.Understanding why we procrastinate allows us to develop effective strategies for getting started on our important projects now, rather than waiting for tomorrow. Here’s what I’ve discovered in my own journey to stop putting things off for later, and the concrete steps I’ve found along the way to address the root cause of my procrastination.Why we procrastinateProcrastination is thought to come from an emotional reaction to whatever it is you’re avoiding. Researchers call this phenomenon “mood repair”, where we avoid the uncomfortable feelings associated with our work by spending time on mood-enhancing activities, like playing games.As Timothy Pychyl, an associate professor of psychology at Carleton University, explained it “putting off the task at hand is an effective way of regulating this mood. Avoid the task, avoid the bad mood.”Of course, the mood lift is inevitably short-term. Studies of college students have found the habit of putting things off only increases negative feelings later on. While procrastinators tended to be less stressed and healthier in the first school term, by the second term these results were actually reversed.This brings us to the second key insight into why we procrastinate: research shows that our brains are actually wired to think about about our present and future selves as two separate people. That’s why we’re able to prioritize our present mood at the expense of our future well-being even though it’s an irrational choice in the long-term.A study run by UCLA psychologist Hal Herschel and a team at Stanford University found that participants actually engaged different areas of the brain when they thought about their present selves versus their future selves. In fact, when people were told to think about themselves in ten years, their brain patterns closely resembled  those observed when they were asked to think about celebrities they didn’t know.This separation of present and future self encourages us to make different decisions about ourselves now and in the future. For instance, one study showed people asked to tutor other students would offer to do so less in the present, but would offer more of their time in the future. To sum up the research, we procrastinate because our brains are wired to care more about our present comfort than our future happiness.So what can we do about it?How to overcome your procrastination habitBased on the research, it’s clear that we have two ways of dealing with our procrastination:Make whatever we’re procrastinating on feel less uncomfortable, andConvince our present selves into caring about our future selves. Here are 8 concrete strategies you can start using today to address the root cause of your procrastination…1. Make getting started ridiculously easyTo overcome our psychological aversion to uncomfortable tasks, Dr Pychyl suggests “[making] the threshold for getting started quite low” and just getting started. Often starting a task is the biggest hurdle.For example, Dr. Pychyl says “A real mood boost comes from doing what we intend to do—the things that are important to us”. Knowing this, we can reason that although getting started might feel uncomfortable, we’re likely to feel much better once the task is done. Compare the mood boost of having done what you intended to do, to the disappointment and frustration of dealing with the consequences of procrastination later.In fact, research shows that progress—no matter how small—can be a huge motivator to help us keep going.My favorite trick for getting into a task I’m dreading, is to start with the mindset. I start by just thinking about the task for a while, until I’m drawn in and can’t help working on it.If it’s a writing task, I might pull up the draft I need to edit and just sit and read over it. Soon I’ll find myself changing a word here and there, or fixing typos. Then I’ll think of a whole sentence I want to add. And suddenly I’m well into the task, without really pushing myself to do so.If it’s coding I need to work on, I do a similar thing. I open the project in Xcode and just look at it for a while. My brain starts to get into the coding mindset as I read over what I’ve written before. I ease myself into the right mindset for this project just by gently immersing myself in it at first. Then I might remove or add a comment, or make a small change to the code. And before I know it I’m stuck into the work I need to get done.Poet and author Mark McGuinness used this method to write a book:A few months ago I just created a file in my book writing software and laid out the chapter headings, and just started playing around and rearranging them. And each time an idea came to me during the day, I just added a quick note inside each chapter. Recently I’ve been opening up the doc in the mornings, just looking at the table of contents, and just adding a few more notes here and there. It’s a slow ramp up where I just tell myself to add a few things here and there, no pressure.When McGuinness wrote that paragraph, he’d already written 12,000 words of his book. “I haven’t really started writing it yet,” he said. “And since I’ve not been officially working on the book, resistance and procrastination hasn’t shown up for work either. It’s been fun.”If it helps, you can also try using a timer for this approach. Set the timer for just 5 or 10 minutes. While the timer’s running, you don’t have to work, but you can’t do anything else. You have to sit with your work, even if you don’t get started. Personally, I’d rather work than do nothing at all, so I wouldn’t even last five minutes before this trick made me get started.2. Do the right thing for the wrong reason
    8. 1. Make getting started ridiculously easy
    1. The problem is that Vivaldi is not adding the code needed to identify the Bookmark Bar Folder to the Bookmarks file located in "User Data\Default" folder.

      Add following code in the Bookmarks file

      "meta_info": {
          "Bookmarkbar": "true"
      }
      

      File location in macOS: $HOME/Library/Application Support/Vivaldi/Default/Bookmarks