- yes,
cross-origin
includes different port numbers. to the IT students everyone pulling their hair out because twolocalhost
s on your machine can't talk to each other: we salute you. - what is a simple request?
- one of [
GET
,HEAD
,POST
] -- no side effects. - the ONLY manual (ie, not added by the browser) headers allowed are:
Accept
Accept-Language
- one of [
Content-Language
const fs = require('fs'); // the node file system package | |
const path = require('path'); | |
// Usage: | |
// node file_tree.js name_of_folder_to_get_files_from | |
// node file_tree.js | |
// Either a passed-in-folder name (process.argv[2]) | |
// or default to the current working directory | |
const folder = process.argv[2] || process.cwd(); |
import { Omit, Overwrapped } from '@emotion/styled-base/types/helper'; | |
import { Interpolation } from '@emotion/serialize'; | |
import { WithTheme, StyledComponent } from '@emotion/styled-base'; | |
// ------- | |
// This is just to shush the compiler | |
type Theme = {}; | |
type InnerProps = {}; |
This was initially specifically in relation to errors when setting up Phoenix/Mix in relation to Postgres.
role "postgres" does not exist"
: https://hexdocs.pm/phoenix/phoenix_mix_tasks.html#ecto-specific-mix-tasks- Try logging in by running
psql
manually first. - If that doesn't work, try:
- From the command line:
psql -d template1
: this logs you into a default database. - Now EXIT
psql
by doing\q;
from their shell; we just logged in to make sure it was possible at all.
- From the command line:
- Try logging in by running
- From the command line:
createdb
. This creates the default database for the user you are currently logged in as.
# hello_asm.s | |
# as hello_asm.s -o hello_asm.o | |
# ld hello_asm.o -e _main -o hello_asm -macosx_version_min 10.6 -lSystem | |
.section __DATA,__data | |
str: | |
.asciz "Hello world!\n" | |
.section __TEXT,__text | |
.globl _main |
These two regular expressions are equivalent. Both use PHP's flavor of PCRE. (The first one might actually work for other languages PCRE variants as well, I'm not sure.) Neither will work for Javascript--it's pretty impossible to tell, but the first one does still have the conditionals, etc., as the second one. Just, you know, illegibly.
You'll have to horizontal-scroll a decent amount on that first one, too. (And also hope you never, ever, ever need to make changes.)
(?:((?:const)|(?:var))|(?:function))\s+(\w+)(?(1)(?:\s*=\s*(?:(?:function)(?:\s*\w+)?)?)|(?=\s*\())\(([^\)]*)\)(\h*=>\s*)?((?s)\s*\{\s*(?-s))?(?(5)([\s\S]*?)return\s)((?:\V++$\v)?(?:^\h+\V+$\v)*)(?(5)^\};?)
and:
Most languages allow a flag called the ignore-whitespace or free-spacing flag. Most of the major languages support it for their regular expression implementations -- with Javascript being the outlier here, as usual. Ruby, PHP, Elixir, etc., all support it. Java too.
What it does is makes it so that when the engine sees whitespace, it ignores it entirely.
So say we wanted to parse some HTML with regular expressions, like this:
/* | |
setup notes: needs the compiler option: | |
`"experimentalDecorators": true,` in your tsconfig | |
*/ | |
function StaticImplements<T>() { | |
return (_constructor: T) => {}; | |
} | |
interface Type<T> { |
/* | |
For sorting the method tables by return type in the Java API. | |
To use: make a bookmarklet whose URL is exactly the following: | |
javascript:(function(){const%20TABLE_CLASS=".memberSummary";const%20ROWS_OTHER_THAN_FIRST_SELECTOR="tr:not(:first-child)";const%20methodTable=document.querySelector(TABLE_CLASS);const%20tbody=methodTable.querySelector("tbody");const%20allRows=tbody.querySelectorAll(ROWS_OTHER_THAN_FIRST_SELECTOR);const%20sortAlphabetically=(firstString,secondString)=>{if(firstString===secondString){return%200;}if(firstString<secondString){return-1;}if(firstString>secondString){return%201;}};const%20sortByInnerText=(firstHtmlElement,secondHtmlElement)=>{const%20firstText=firstHtmlElement.innerText;const%20secondText=secondHtmlElement.innerText;return%20sortAlphabetically(firstText,secondText);};const%20sortRowByFirstColumn=(firstRow,secondRow)=>{return%20sortByInnerText(firstRow.querySelector("td"),secondRow.querySelector("td"));};const%20sortByJdocRowId=(firstJavadocRow,secondJavadocRow)=>{c |