Skip to content

Instantly share code, notes, and snippets.

View gko's full-sized avatar
🧑‍🍳

Konstantin gko

🧑‍🍳
View GitHub Profile
@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active October 29, 2024 21:43
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version
@adamgit
adamgit / .gitignore
Last active March 20, 2025 10:01
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
@junegunn
junegunn / gist:f4fca918e937e6bf5bad
Last active March 14, 2025 22:42
Browsing git commit history with fzf
# fshow - git commit browser (enter for show, ctrl-d for diff, ` toggles sort)
fshow() {
local out shas sha q k
while out=$(
git log --graph --color=always \
--format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" |
fzf --ansi --multi --no-sort --reverse --query="$q" \
--print-query --expect=ctrl-d --toggle-sort=\`); do
q=$(head -1 <<< "$out")
k=$(head -2 <<< "$out" | tail -1)
@DarrenN
DarrenN / get-npm-package-version
Last active April 12, 2025 14:15 — 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

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@taoyuan
taoyuan / npm-using-https-for-git.sh
Last active November 18, 2024 08:50
Force git to use https:// instead of git://
# npm using https for git
git config --global url."https://github.com/".insteadOf [email protected]:
git config --global url."https://".insteadOf git://
# npm using git for https
git config --global url."[email protected]:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
@mhulse
mhulse / fromhex.bash
Last active October 27, 2024 03:40
Bash function to convert hex to 256 terminal color.
# fromhex A52A2A
# fromhex "#A52A2A"
# BLUE_VIOLET=$(fromhex "#8A2BE2")
# http://unix.stackexchange.com/a/269085/67282
function fromhex() {
hex=$1
if [[ $hex == "#"* ]]; then
hex=$(echo $1 | awk '{print substr($0,2)}')
fi
r=$(printf '0x%0.2s' "$hex")
@gko
gko / stream.sh
Created January 8, 2017 14:11
stream your system audio to network
#!/bin/bash
# you can find listbox `https://github.com/gko/listbox`
source ~/listbox/listbox.sh
listbox -t "Stream:" -o "$(pactl list | grep "Monitor Source" | sed -e "s/.*Monitor Source:\s//" | tr '\n' '|')" -r stream
echo ""
cvlc -vvv pulse://"$stream" --sout '#transcode{acodec=mp3,ab=128,channels=2}:standard{access=http,dst=0.0.0.0:8888/t.mp3}'
@gko
gko / project.sh
Last active January 21, 2017 14:18
create npm project both locally and on github
#!/usr/bash
# Create npm package and repo for it on github
# usage: project test
# for private repo: project -p test
project() {
while [[ $# -gt 0 ]]
do
key="$1"
@gko
gko / Menu.html
Last active May 2, 2017 06:39
burger menu
<div class="Menu">
<div class="Menu-line"></div>
<div class="Menu-line"></div>
</div>