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
#!/bin/sh | |
# | |
# Commit hook to add a JIRA ticket reference as a prefix to any commit messages. | |
# NOTE: JIRA ticket number MUST be included in branch name or it does nothing... | |
# Doesn't make any specific checks, just does it. | |
BRANCH_NAME=$(git branch | grep '*' | sed 's/* //') | |
REGEX_TICKET_ID='([A-Z]{3,4}-[0-9]{4})' | |
# Do the regex search |
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
import { validate } from 'class-validator'; | |
const validationErrors = await validate(objInstance); | |
if (validationErrors.length > 0) { | |
throw new BadRequestException( | |
validationErrors.map( | |
({ property, constraints }) => | |
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | |
`${property}: ${Object.values(constraints!)[0]}`, |
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
----------------- | |
TMUX CHEATSHEET | |
----------------- | |
Prefix for commands and help: | |
Ctrl-b and sth: issue a command to tmux, inside tmux. | |
Ctrl-b and ?: see all commands. | |
------------------------------------------------------------------- | |
Session commands: |
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
class Tracker { | |
_servers = []; | |
/** | |
* | |
* @param {string} hostType | |
* @example | |
* allocate("south") | |
*/ | |
allocate(hostType) { |
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
// ...... other BaseModel code | |
/** | |
* Recursively serialize properties through class getters | |
* Returns ready object for JSON.stringify() | |
*/ | |
public toJSON(): any { | |
const proto = Object.getPrototypeOf(this); | |
const jsonObj = { | |
[BaseModel.umt]: proto.constructor.universalModelType() |
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
// ES5 | |
var Element = (function() { | |
function Element() { | |
this._class = null; | |
} | |
Object.defineProperty(Element.prototype, 'className', { | |
get: function() { | |
return this._class; | |
}, | |
set: function(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
{ | |
"Styled Component Media Query": { | |
"prefix": "media", | |
"body": [ | |
"@media ($1-width: $2) {", | |
"\t$0", | |
"}" | |
], | |
"description": "Media Query" | |
}, |
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
{ | |
"Styled Component Media Query": { | |
"prefix": "media", | |
"body": [ | |
"@media ($1-width: $2) {", | |
"\t$0", | |
"}" | |
], | |
"description": "Media Query" | |
}, |
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
{ | |
"Import React": { | |
"prefix": "imr", | |
"body": ["import React from 'react'"], | |
"description": "Import React" | |
}, | |
"Import PropTypes": { | |
"prefix": "impt", | |
"body": ["import PropTypes from 'prop-types'"], |
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
// Future versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
// choose either `'stable'` for receiving highly polished, | |
// or `'canary'` for less polished but more frequent updates | |
updateChannel: 'stable', |
NewerOlder