Skip to content

Instantly share code, notes, and snippets.

@sdieunidou
sdieunidou / rabbitmq.txt
Created October 22, 2015 19:51
create admin user on rabbitmq
rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
@timruffles
timruffles / ports.ex
Last active February 8, 2023 14:53
erlang ports bewlider me
defmodule LearningPorts do
def main do
parent = self()
# if we need to control STDIN, the fun begins:
# unfortunately we can't close the port's stdin without closing the port.
# so it'll block waiting forever for an EOF that'll never appear.
#
# so we use a wrapper program that allows us to specify a sentinel line
@cpliakas
cpliakas / ant-composer.xml
Created November 26, 2013 01:20
Apache Ant tagets for Composer commands.
<?xml version="1.0" encoding="UTF-8"?>
<project name="Composer Targets" default="build">
<property name="builddir" value="${basedir}/build"/>
<property name="composer" value="${builddir}/composer.phar"/>
<target name="php-check">
<condition property="php" value="php">
<not>
<isset property="${php}"/>
@mattratleph
mattratleph / vimdiff.md
Last active April 24, 2024 11:28 — forked from roothybrid7/vimdiff_cheet.md
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 7, 2024 06:03
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@hrldcpr
hrldcpr / tree.md
Last active May 1, 2024 00:11
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@justjkk
justjkk / LICENSE
Last active April 7, 2024 16:57
Parsing JSON with lex and yacc
The MIT License (MIT)
Copyright (c) 2015 J Kishore Kumar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@matagus
matagus / hgrc
Created June 9, 2010 13:34
colorize your hg output <3
[extensions]
# enable color extension
color =
# enable extdiff extension (Extended Diff)
hgext.extdiff =
[extdiff]
# configure extended diff to use colordiff (requires colordiff installed in your system)
cmd.cdiff = colordiff
opts.cdiff = -uprN
@runeb
runeb / .gems
Created January 12, 2010 12:30
# Heroku .gems file
oauth
nokogiri