Skip to content

Instantly share code, notes, and snippets.

View dazzz1er's full-sized avatar

Dan James Britchford dazzz1er

View GitHub Profile
@dazzz1er
dazzz1er / post-commit
Created May 19, 2015 12:44
Slack notify on git commit
#!/bin/sh
#notifyslack.bat
message=$(git log -1 HEAD --pretty=format:%s)
curl -X POST --data-urlencode 'payload={"channel": "#channel", "username": "<project>bot", "text": "<Project> was updated: '"$message"'", "icon_emoji": ":ghost:"}' hook_url
@dazzz1er
dazzz1er / js-socket-io-redis.js
Last active August 23, 2021 01:10
Socket.io, Redis implementation
<script src="https://cdn.socket.io/socket.io-1.3.5.js"></script>
<script>
var socket = io('http://localhost:3000');
socket.on('test-channel:Test', function(message) {
console.log(message); // Object { user : 'danje', status : 'awesome' }
});
</script>