Skip to content

Instantly share code, notes, and snippets.

@danriti
danriti / hipchat-v2.sh
Last active July 18, 2024 14:34
HipChat API v2 - Send a message to a room using cURL
#!/bin/bash
# Set the ROOM_ID & AUTH_TOKEN variables below.
# Further instructions at https://www.hipchat.com/docs/apiv2/auth
ROOM_ID=XXX
AUTH_TOKEN=XXX
MESSAGE="Hello world!"
curl -H "Content-Type: application/json" \
@joseluisq
joseluisq / terminal-git-branch-name.md
Last active July 4, 2024 15:00
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() {
@leelakrishna
leelakrishna / hifreqwords.scala
Last active January 29, 2021 13:01
Spark scala - most frequent words
val f = sc.textFile("sample.txt")
// word count
val wc = f.flatMap(l => l.split(" ")).map(word => (word,1)).reduceByKey(_ + _)
// swap k,v to v,k to sort by word frequency
val wc_swap = wc.map(_.swap)
// sort keys by ascending=false (descending)
val hifreq_words = wc_swap.sortByKey(false,1)
hifreq_words.saveAsTextFile("hifreq_words")
// get an array of top 20 frequent words
val top20 = hifreq_words.take(20)
@djonsson
djonsson / install_elasticsearch_osx.md
Last active November 11, 2022 21:10
OS X installation instructions for Elasticsearch + Kibana + Marvel

What is this?

Following this guide will set up a local Elasticsearch with Kibana and Marvel using Homebrew and Homebrew Cask

Prerequisites

If you already have Java installed on your system, skip steps Install Cask and Install Java

If you already have Java and Homebrew installed on your system, skip steps Prerequisites, start at Install Elasticsearch and Kibana after running $ brew update

Install Homebrew

  • $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@aseigneurin
aseigneurin / Spark high availability.md
Created November 1, 2016 16:42
Spark - High availability

Spark - High availability

Components in play

As a reminder, here are the components in play to run an application:

  • The cluster:
    • Spark Master: coordinates the resources
    • Spark Workers: offer resources to run the applications
  • The application:
@janlukasschroeder
janlukasschroeder / extracting-financial-statements-from-sec-filings.ipynb
Last active July 17, 2024 13:26
extracting-financial-statements-from-sec-filings.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.