Skip to content

Instantly share code, notes, and snippets.

View arkka's full-sized avatar

Arkka Dhiratara arkka

View GitHub Profile
@jgautheron
jgautheron / errorHandler.js
Created May 10, 2017 14:52
Send client errors to the server
import ReactUpdates from 'react-dom/lib/ReactUpdates'
import ReactDefaultBatchingStrategy from 'react-dom/lib/ReactDefaultBatchingStrategy'
import 'isomorphic-fetch'
const logError = (err, extra = {}) => {
fetch('/logger', {
method: 'POST',
credentials: 'same-origin',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
@demmer
demmer / slack-messages-by-user.py
Created December 2, 2016 22:59
count slack messages posted to a channel by user
#!/usr/bin/python
'''
Script to count messages by user posted to a channel for a given date range.
Install:
# sudo pip install slackclient
Also you will need to obtain a slack API token:
https://api.slack.com/docs/oauth-test-tokens
@yosriady
yosriady / DESIGN.md
Last active February 17, 2024 15:08
OAuth2 Authentication Microservices Design

Auth

Disclaimer

Creating an OAuth2 server is not a task that should be taken lightly. There are many security loopholes that could be exploited, and regular examinations are critical to handle possible vulnerabilities.

Introduction

Auth is an authentication microservice based on the OAuth2 identity delegation protocol.

@bonzanini
bonzanini / run_luigi.py
Created October 24, 2015 14:56
Example of Luigi task pipeline
# run with a custom --n
# python run_luigi.py SquaredNumbers --local-scheduler --n 20
import luigi
class PrintNumbers(luigi.Task):
n = luigi.IntParameter(default=10)
def requires(self):
return []
@garycrawford
garycrawford / docker-compose.yml
Created July 9, 2015 13:00
MongoDB Replica Set docker-compose.yml
primary:
image: mongo:3.0
volumes:
- ./p:/data
ports:
- "27017:27017"
# Our current version of docker-compose doesn't allow extra_hosts which would be the best way
# to add curcular dependency container links in this case. We cant upgrade docker-compose
# without upgrading docker to 1.7, and we can't do that without upgrading the kernel on our
# CentOS VM's. As such we are using the hostname hask below to allow primary and secondary
@ololobus
ololobus / Spark+ipython_on_MacOS.md
Last active November 22, 2022 22:24
Apache Spark installation + ipython/jupyter notebook integration guide for macOS

Apache Spark installation + ipython/jupyter notebook integration guide for macOS

Tested with Apache Spark 2.1.0, Python 2.7.13 and Java 1.8.0_112

For older versions of Spark and ipython, please, see also previous version of text.

Install Java Development Kit

@vincent99
vincent99 / gist:491afed2306ba448dd89
Last active August 14, 2019 01:16
Simple example of subscribing to Rancher change events
/*
Setup:
npm install ws
Usage:
Create an API key in Rancher and start up with:
node socket.js address.of.rancher:8080 access_key secret_key project_id
*/
var WebSocket = require('ws');
@robcowie
robcowie / spark_notes.md
Last active April 11, 2022 22:30
Apache Spark Notes

Install Apache Spark (OSX)

$ brew install apache-spark

Run the Spark python shell

A python shell with a preconfigured SparkContext (available as sc). It is

@hkhamm
hkhamm / installing_cassandra.md
Last active May 5, 2024 13:14
Installing Cassandra on Mac OS X

Installing Cassandra on Mac OS X

Install Homebrew

Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"