This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; -*- mode: emacs-lisp -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Configuration Layers declaration. | |
You should not put any user code in this function besides modifying the variable | |
values." | |
(setq-default | |
;; Base distribution to use. This is a layer contained in the directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns s3-edit | |
(:require [clojure.string :as str] | |
[clojure.java.shell :as sh] | |
[clojure.java.io :as io]) | |
(:import (java.util UUID))) | |
(defn s3-edit [s3-path] | |
(let [temp-secrets-file-name (str "./temp-secrets-" (UUID/randomUUID) ".json")] | |
(sh/sh "aws" "s3" "cp" s3-path temp-secrets-file-name) | |
(-> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface UserFilter { | |
status: string; | |
} | |
const getUsersEmail = (filter: UserFilter): string[] => { | |
// some code | |
const status = filter.status; | |
const filteredUsers = users.filter(({ status }) => status === filter.status); | |
const emails = filteredUsers.map(({ email }) => email); | |
return emails; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface UserFilter { | |
status: string; | |
} | |
interface User { | |
name: string; | |
email: string; | |
status: string; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const users = fetchUsers('5', { userStatus: 'active' }); | |
// Ideally the status should be an enum or a constant instead of replicating the string everyplace. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetchUsers = (page: any, filter: any): any[] => { | |
// more code | |
const offset = page * pageSize; | |
// some code | |
const status = filter.status; | |
// more code | |
return users; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getUser = (id: any): any { | |
// some code | |
} | |
// vs | |
interface User { | |
id: string; | |
name: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.viewContainerRef.createEmbeddedView(this.templateRef, this.context); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- "let val = val" -> let-val="val" | |
- "let hero of heros" -> let-hero and [ngForOf]="hero" | |
- "trackBy: trackById" -> [ngForTrackBy]="trackById |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<autocomplete | |
*sWAutocomplete="let options = options; let onSearchChange = onSearchChange" | |
[options]="options" | |
[placeholder]="'Search for Star Wars characters'" | |
(searchTermChange)="onSearchChange($event)" | |
(selectItem)="onSelectItem($event)"> | |
</autocomplete> | |
<!-- is transformed in --> |
NewerOlder