Skip to content

Instantly share code, notes, and snippets.

View disintegrator's full-sized avatar

Georges Haidar disintegrator

View GitHub Profile
@disintegrator
disintegrator / .vimrc
Last active March 2, 2016 05:49
My .vimrc so far... (with the help of Vundle)
set nocompatible
syntax on
filetype off
set colorcolumn=80
set ignorecase
set laststatus=2
set noshowmode
set hlsearch
set cul
@disintegrator
disintegrator / tmux.conf
Last active August 29, 2015 13:56
My tmux config so far...
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
set -g base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
# vi is good
setw -g mode-keys vi
bind-key -t vi-copy v begin-selection
@disintegrator
disintegrator / Cassandra-OpsCenter-Compose.md
Last active October 12, 2016 11:35
OSX: 3-node Cassandra cluster + OpsCenter using Docker Compose
brew install boot2docker
eval $(boot2docker shellinit)
boot2docker up
sudo pip install -U docker-compose

# put the docker-compose.yml file in a directory e.g. ~/Work/docker/cassandra

cd ~/Work/docker/cassandra
docker-compose up
@disintegrator
disintegrator / gencert.sh
Last active August 29, 2015 14:22
Easy SSL Certificates for dev
alias ssl=openssl
ssl genrsa -aes256 -passout pass:x -out server.pass.key 2048
ssl rsa -passin pass:x -in server.pass.key -out server.key
rm server.pass.key
ssl req -sha256 -new -key server.key -out server.csr
ssl x509 -sha256 -req -days 365 -in server.csr -signkey server.key -out server.crt
@disintegrator
disintegrator / oauth_flows.md
Last active September 2, 2015 05:41
API and design notes for an OAuth2 provider with threat mitigation strategies

Overview

This design must be aware of the OAuth2 thread models and mitigation strategies as described in the following resources:

  • [OAuth 2.0 Threat Model and Security Considerations][1]
  • [OAuth Security][2]
  • [Common OAuth2 Vulnerabilities and Mitigation Techniques][3]
  • [OAuth1, OAuth2, OAuth...?][4]

A host of vulnerabilities can be removed by pinning redirect_uri, scope, response_type (read: allowed grants for each client) variables in client settings when registering clients (apps).

@disintegrator
disintegrator / actionhelpers.js
Last active November 10, 2015 04:01
Redux async action helpers
import * as ra from 'redux-actions'
export const {createAction} = ra
export function createAsyncAction(name, worker) {
const request = `${name}_REQUEST`
const success = `${name}_SUCCESS`
const fail = `${name}_FAIL`
const stages = {
request: createAction(request),
success: createAction(success),

Keybase proof

I hereby claim:

  • I am disintegrator on github.
  • I am disintegrator (https://keybase.io/disintegrator) on keybase.
  • I have a public key whose fingerprint is B27D E9C9 E08C A86E F46B 84FA F60F 7D8E 4BAD 4281

To claim this, I am signing this object:

@disintegrator
disintegrator / main.ts
Last active November 14, 2020 06:58
RxJS + Axios
import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';
import { Observable } from 'rxjs';
const fromRequest = (request: AxiosRequestConfig) =>
new Observable<AxiosResponse>(
(o) => {
const source = axios.CancelToken.source();
o.add(() => source.cancel('Operation canceled by the user.'));
@disintegrator
disintegrator / redux.ts
Created May 11, 2017 23:25
Redux TS boilerplate
export type ActionType = string;
export interface Action<T extends ActionType> {
type: T;
}
export interface BasicAction<T extends ActionType, P> extends Action<T> {
payload: P;
}
@disintegrator
disintegrator / wdio.conf.js
Created June 9, 2017 04:13
Run Chrome Headless with WebdriverIO and selenium-standalone
exports.config = {
capabilities: [
{
browserName: 'chrome',
chromeOptions: {
args: ['headless', 'disable-gpu'],
},
},
],
services: ['selenium-standalone'],