Skip to content

Instantly share code, notes, and snippets.

@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active July 29, 2025 11:23
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
@intarstudents
intarstudents / screentab.sh
Created November 29, 2011 22:58
screentab
#!/bin/sh
error() { echo "$@" 1>&2; exit 1; }
[ $# -gt 1 ] ||
error "must provide screen session name and command"
session="${1}"
shift;
found=$(screen -ls | awk '-F\t' '$2 ~ m {print $2}' "m=[0-9]+[.]$session$")
@intarstudents
intarstudents / compiling_zeromq.md
Last active October 6, 2015 21:58
Compiling ZeroMQ

Dependencies:

$ aptitude install libtool autoconf automake uuid-dev

Installation commands:

$ git clone https://github.com/zeromq/zeromq3-x.git
@superbrothers
superbrothers / ansi-color.php
Created August 23, 2012 01:49
ANSI color terminal output module for php
<?php
/**
* php-ansi-color
*
* Original
* https://github.com/loopj/commonjs-ansi-color
*
* @code
* <?php
* require_once "ansi-color.php";
@intarstudents
intarstudents / fix_synapse_apps.sh
Created November 13, 2012 20:58
Linux Mint 13 & 14 (MATE) - Fix missing application shortcuts in Synapse
#!/bin/sh
for file in $(grep -il "^OnlyShowIn=MATE;$" /usr/share/applications/*.desktop); do
echo "patching $file"
sed -e "s/OnlyShowIn=MATE;/#OnlyShowIn=MATE;/ig" $file > /tmp/tempfile.tmp
mv -f /tmp/tempfile.tmp $file
done
@intarstudents
intarstudents / pgadmin-ppa.sh
Created January 21, 2013 10:37
Ubuntu pgAdmin PPA
apt-add-repository ppa:pitti/postgresql
apt-get update && apt-get upgrade
@crosbymichael
crosbymichael / Dockerfile
Last active January 8, 2022 13:47
Docker with supervisor
FROM ubuntu
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade
RUN apt-get install -y openssh-server supervisor
ADD sshd.conf /etc/supervisor/conf.d/sshd.conf
RUN mkdir -p /var/run/sshd
@JalfResi
JalfResi / revprox.go
Last active August 9, 2025 19:56
Simple reverse proxy in Go
package main
import(
"log"
"net/url"
"net/http"
"net/http/httputil"
)
func main() {
@nicolashery
nicolashery / elasticsearch.md
Last active December 30, 2023 19:03
Elasticsearch: updating the mappings and settings of an existing index

Elasticsearch: updating the mappings and settings of an existing index

Note: This was written using elasticsearch 0.9.

Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:

$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
  "_id": 1,
@intarstudents
intarstudents / README.md
Created December 18, 2013 08:40
Upgrade debian to testing

Stolen from here:

sudo cp /etc/apt/sources.list{,.bak}
sudo sed -i -e 's/ \(stable\|wheezy\)/ testing/ig' /etc/apt/sources.list
sudo apt-get update
sudo apt-get --download-only dist-upgrade
sudo apt-get dist-upgrade