Skip to content

Instantly share code, notes, and snippets.

@mjj2000
mjj2000 / get-current-git-tag.sh
Last active April 1, 2024 01:11
[GIT] Get tag of current branch(that is HEAD) or fallback to short commit hash(7 digits) by single shell command
git describe --exact-match --tags 2> /dev/null || git rev-parse --short HEAD
@staltz
staltz / introrx.md
Last active April 20, 2024 14:15
The introduction to Reactive Programming you've been missing
@EdCharbeneau
EdCharbeneau / Enable-Transformations.md
Last active March 13, 2024 09:18
How to enable transformations on build with Visual Studio

#Transform web.config on build

  1. Unload the project
  2. Edit .csproj
  3. Append figure 1 to the end of the file just before </Project>; v12.0 my change depending on your version of Visual Studio
  4. Save .csproj and reload
  5. Open configuration manager
  6. Add a new Configuration Name: Base. Copy settings from: Release
  7. Copy the contents of your web.config
  8. Right click Web.Config > Add Config Transformation
@crtr0
crtr0 / client.js
Created June 8, 2012 17:02
A simple example of setting-up dynamic "rooms" for socket.io clients to join
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});