This is the reference point. All the other options are based off this.
|-- app
| |-- controllers
| | |-- admin
⇐ back to the gist-blog at jrw.fi
Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.
I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.
This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso
| /** | |
| * | |
| * Javascript color conversion | |
| * http://www.webtoolkit.info/javascript-color-conversion.html | |
| * | |
| **/ | |
| function HSV(h, s, v) { | |
| if (h <= 0) { h = 0; } | |
| if (s <= 0) { s = 0; } |
| !! | |
| !! Implementation of JSONPatch (http://jsonpatch.com/) using PostgreSQL >= 9.5 | |
| !! | |
| CREATE OR REPLACE FUNCTION jsonb_copy(JSONB, TEXT[], TEXT[]) RETURNS JSONB AS $$ | |
| DECLARE | |
| retval ALIAS FOR $1; | |
| src_path ALIAS FOR $2; | |
| dst_path ALIAS FOR $3; | |
| tmp_value JSONB; |
| #!/bin/bash | |
| # SET THIS TO BE YOUR DESIRED USERNAME | |
| export MY_USER_NAME_FOR_CERT=`whoami` | |
| # This directory is optional, but will use it to keep the CA root key safe | |
| mkdir keys certs | |
| chmod og-rwx keys certs | |
| # Set up a directory that will serve as the pgconf mount |
| const { execSync } = require('child_process') | |
| const { createHash } = require('crypto') | |
| const invertColor = require('invert-color') | |
| const branchName = execSync('git rev-parse --abbrev-ref HEAD') | |
| const hash = createHash('sha256') | |
| hash.update(branchName) | |
| const color = '#' + hash.digest().toString('hex').substring(0, 6) | |
| const invertedColor = invertColor(color, true) |
| #!/usr/bin/env bash | |
| set -Eeuo pipefail | |
| trap cleanup SIGINT SIGTERM ERR EXIT | |
| script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
| usage() { | |
| cat <<EOF | |
| Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] |
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.
This means you have the following choices:
import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.await import(…) from CommonJS instead of require(…).| import * as bcrypt from "bcrypt"; | |
| import { createCookieSessionStorage, redirect } from "remix"; | |
| import { db } from "./db.server"; | |
| export type LoginForm = { | |
| username: string; | |
| password: string; | |
| }; |