Skip to content

Instantly share code, notes, and snippets.

@daliborgogic
daliborgogic / index.js
Last active December 9, 2022 03:40
amqp async/await node.js
const amqp = require('amqplib')
const eventEmitter = require('events')
class OopsEmitter extends eventEmitter {}
const oopsEmitter = new OopsEmitter()
;(async () => {
try {
const conn = await amqp.connect('amqp://localhost?heartbeat=5s')
const ch = await conn.createChannel()
@domanchi
domanchi / cheatsheet.md
Last active April 5, 2024 06:30
[splunk cheatsheet] Splunk snippets, because their syntax is so confusing. #splunk

Splunk Queries

I really don't like Splunk documentation. Why is it so hard to find out how to do a certain action? So this is a cheatsheet that I constructed to help me quickly gain knowledge that I need.

Analysis

Events over time

index="my_log"
@rueycheng
rueycheng / GNU-Make.md
Last active June 25, 2024 13:22
GNU Make cheatsheet
@subfuzion
subfuzion / curl.md
Last active July 3, 2024 11:43
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@joseluisq
joseluisq / terminal-git-branch-name.md
Last active June 14, 2024 19:05
Add Git Branch Name to Terminal Prompt (Linux/Mac)

Add Git Branch Name to Terminal Prompt (Linux/Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {
@anandsunderraman
anandsunderraman / html.snippet.xml
Last active August 29, 2015 14:05
Sublime Text 2 HTML Snippet
<snippet>
<content><![CDATA[
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src=""></script>
<link rel="stylesheet" href="">
</head>
@staltz
staltz / introrx.md
Last active July 2, 2024 03:45
The introduction to Reactive Programming you've been missing
@speric
speric / gist:6096965
Created July 28, 2013 01:20
vimtutor Lesson Summaries
Lesson 1 SUMMARY
1. The cursor is moved using either the arrow keys or the hjkl keys.
h (left) j (down) k (up) l (right)
2. To start Vim from the shell prompt type: vim FILENAME <ENTER>
3. To exit Vim type: <ESC> :q! <ENTER> to trash all changes.
OR type: <ESC> :wq <ENTER> to save the changes.
@robertklep
robertklep / bind.js
Last active December 18, 2015 04:59
var f = function(value) {
console.log('value:', value);
};
var x = f.bind(f, 'foo'); // pass 'foo' as a pre-specified argument to f(), and return it as a new function x()
x();
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"