Skip to content

Instantly share code, notes, and snippets.

View nightire's full-sized avatar
Looking for new opportunities

余凡 nightire

Looking for new opportunities
View GitHub Profile
// A launch configuration that compiles the extension and then opens it inside a new window
{
"version": "0.1.0",
"configurations": [
{
"name": "Attach by Process ID",
"processId": "${command:PickProcess}",
"request": "attach",
"resolveSourceMapLocations": null,
"sourceMaps": true,
@olivierlacan
olivierlacan / migrate_postgresql_database.md
Last active March 24, 2022 20:30
How to migrate a Homebrew-installed PostgreSQL database to a new major version (9.3 to 9.4) on OS X. See upgraded version of this guide: http://olivierlacan.com/posts/migrating-homebrew-postgres-to-a-new-version/

This guide assumes that you recently run brew upgrade postgresql and discovered to your dismay that you accidentally bumped from one major version to another: say 9.3.x to 9.4.x. Yes, that is a major version bump in PG land.

First let's check something.

brew info postgresql

The top of what gets printed as a result is the most important:

@maxfierke
maxfierke / cancelable-fetch.js
Last active April 21, 2022 18:15
cancelableFetch Yieldable ember-concurrency
import { Yieldable } from 'ember-concurrency';
import fetch from 'fetch'; // i.e. ember-fetch. could also use native fetch too.
class FetchYieldable extends Yieldable {
constructor(url, opts = {}) {
super(...arguments);
this.url = url;
this.opts = opts;
}
@aprilmintacpineda
aprilmintacpineda / NodeJS require local modules resolver.md
Last active May 13, 2022 10:38
NodeJS require concept for local modules

NodeJS require concept for local modules

The problem

As your NodeJS app grows bigger, the file structure tends to go 3 to even 5 layers deep. The problem now is as you require local modules you created, you'll have to write them in this way:

const myModule = require('../../../my/module');
@pichfl
pichfl / example.hbs
Last active October 4, 2022 19:01
Media query helper for Ember.js
{{#if (match-media "(max-width:800px)")}}
MediaQuery matches
{{ else}}
MediaQuery doesn't match
{{/if}}
const AudioPrimitiveContext = React.createContext<InterpreterFrom<
typeof audioMachine
> | null>(null);
export const AudioPrimitiveProvider = ({
children,
}: {
children?: React.ReactNode;
}) => {
const [machine] = React.useState(() => {
@wonderbeyond
wonderbeyond / drag-drop-sort-design-implementation.md
Last active April 4, 2023 04:34
Drag-drop sort: Design & Implementation
@kristianmandrup
kristianmandrup / Converting libraries to Ember CLI addons.md
Last active April 21, 2023 17:14
Guide to Developing Addons and Blueprints for Ember CLI

Converting libraries to Ember CLI addons

In this guide we will cover two main cases:

  • Ember specific library
  • vendor library

Ember library

The Ember library will assume that Ember has already ben loaded (higher in the loading order) and thus will assume it has access to the Ember API.

@fabiospampinato
fabiospampinato / build.js
Created May 23, 2021 20:21
Fast building + watching + starting + restarting. AKA how to throw TypeScript in the garbage bin for anything other than type-checking.
/* IMPORT */
const esbuild = require ( 'esbuild' );
const {nodeExternalsPlugin} = require ( 'esbuild-node-externals' );
const monex = require ( 'monex' );
const path = require ( 'path' );
const {color, parseArgv} = require ( 'specialist' );
const Watcher = require ( 'watcher' );
@jessejanderson
jessejanderson / intro-to-otp-in-elixir-resources.md
Last active June 15, 2023 05:03
Intro to OTP in Elixir - Resources