Skip to content

Instantly share code, notes, and snippets.

@tonysneed
tonysneed / vs-code-ts-version.md
Created October 23, 2016 07:09
Use Specific Version of TypeScript with VS Code

NOTE: These steps are only required if you want to use a version of TypeScript that is not the same as the version that is bundled with Visual Studio Code.

  • Install the latest version of TypeScript

    npm install -g typescript@version
    
  • Configure VS Code to use installed version of TypeScript by opening Preferences, User Settings.

@HaleTom
HaleTom / git-quote-string-multiline
Created October 1, 2016 03:21
Quote a single- or multi-line string for use in git's aliases
#!/bin/bash -eu
# Quote a single- or multi-line string for use in git's aliases
# Copyright (c) 2016 Tom Hale under https://en.wikipedia.org/wiki/MIT_License
quote() {
printf %s "$1" | sed -r 's/(["\\])/\\\1/g';
}
IFS=$(printf '\n')
@alexproca
alexproca / docker-machine-rename
Last active January 6, 2025 20:05
Rename docker-machine
#!/usr/bin/env bash
#copy this in a folder from path ex: /usr/local/bin
#usage: docker-machine-rename default my-default
# Authors
#
# alexproca initial script
# eurythmia sed magic
@Ladicek
Ladicek / maven-deploy-sources.sh
Created January 7, 2016 09:51
deploy *-sources.jar to internal Maven repository
#!/bin/bash
# successful "mvn clean install" or a variant thereof (e.g. -DskipTests)
# is typically required before running this script
REPOSITORY_ID=...
REPOSITORY_URL=...
mvn clean source:jar
@rponte
rponte / get-latest-tag-on-git.sh
Last active December 9, 2024 00:27
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
@DarrenN
DarrenN / get-npm-package-version
Last active May 2, 2025 08:59 — forked from yvele/get-npm-package-version.sh
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION
@v0lkan
v0lkan / nginx.conf
Last active April 15, 2025 11:53
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
@traeH-Heart
traeH-Heart / Project Directory Structure
Created March 2, 2015 06:19
Recommended Project Directory Structure
<project name>/
application/
configs/
application.ini
controllers/
helpers/
forms/
layouts/
filters/
helpers/
@domenic
domenic / opensearch.xml
Last active February 19, 2023 02:33
opensearch.xml for HTML Standard
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>HTML Standard</ShortName>
<Description>Search the WHATWG HTML Living Standard.</Description>
<Image width="16" height="16" type="image/x-icon">data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC2klEQVR4Xm3TbUxWZRjA8f95eY4PvrTGB0UGYxUuKjVYoRauBa0aai5rxbKcLxvSEBZogG5uQc4NncUe1HDU+uBMCiLUKKmRUGLzDQJdKQjqHLpswOppPC/nHJ6rcz6c7Ynx+3B/uq/r3nVf16Ws3DWbadJEpGAqZq+1Y9YjCKqmamOa5utUFfU4cIE4Ov+3IWpH9iMkJT2YStr8DHy6wb2J2/NHx4cfD5uhrQlGQj0o1UAYQMUDlc6Fo+lJS5L2rD9Ga9UQBws7+GjTSZp2DPBp8Vlyl6zzh6LhypjEWoF58QnecYL35WTk01D0E88vXseJC42Uf76GLYeeZW/LVkLRILUbmtmcV4Uds/NFYkcAXQVSTSsaWLRwKe7Lhs/Pu0dyqWkuxbItnkjNpneky0mUR5uTtGR1LW88U0zYjKwH3iJnV0JF9vuanO49Jq6OviZ5rASpb68Qz+Bon7h3Cg8/J67xf+/Lqj0psqLSdwrn+O6VvWkSnJwQ193xW9Jz7XsJhibE0/NHuywtQ0obXxbPh19tkazt3ObpHVzb1viizMQLfqk6WZZXzpYzV1rFc/znOsks5x9VwGfos5jJ+aEfnY98
@josephspurrier
josephspurrier / values_pointers.go
Last active February 27, 2025 15:19
Golang - Asterisk and Ampersand Cheatsheet
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value