Skip to content

Instantly share code, notes, and snippets.

int n, m;
set<int> g[10001];
int indeg[10001];
int o[10001];
set<int> se;
inline
void solve() {
int idx = 0;
int cur;
int k;
@gabber12
gabber12 / dinics.cpp
Last active December 15, 2015 12:09
Max Flow Algorithm Dinitz algo.
/* Author - Gabber12
Max Flow Algorithm
Dinics Algo
O(V^2*E)
*/
vii g[MAXN];
int cst[MAXN][MAXN];
int sink, src;
int dis[MAXN];
int bfs() {
#define MAXN 121
vector<vii > g;
vii used;
vii pl, pr;
bool kuhn(int v) {
int k;
if(used[v]) return false;
used[v] = true;
forall(i, 0, g[v].size()) {
@gabber12
gabber12 / pysvnClient.py
Created April 8, 2015 22:21
Pysvn setup
import pysvn
def get_login( realm, username, may_save ):
svn_username = settings.SVN_USERNAME
svn_password = settings.SVN_PASSWORD
return True, svn_username, svn_password, True
def ssl_server_trust_prompt(trust_dict):
return True, 5, True
execute pathogen#infect()
syntax on
set number
set autoread
nnoremap tl :tabnext<CR>
nnoremap th :tabprev<CR>
nnoremap tn :tabnew<CR>
filetype plugin on
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
### INSTALLATION NOTES ###
# 1. Install Homebrew (https://github.com/mxcl/homebrew)
# 2. brew install zsh
# 3. Install OhMyZsh (https://github.com/robbyrussell/oh-my-zsh)
# 4. brew install reattach-to-user-namespace --wrap-pbcopy-pbpaste && brew link reattach-to-user-namespace
# 5. Install iTerm2
# 6. In iTerm2 preferences for your profile set:
# Character Encoding: Unicode (UTF-8)
# Report Terminal Type: xterm-256color
# 7. Put itunesartist and itunestrack into PATH
@gabber12
gabber12 / .vimrc
Created March 11, 2016 14:43
new Vimrc
call plug#begin()
Plug 'scrooloose/nerdtree'
Plug 'vim-scripts/Solarized'
Plug 'ervandew/supertab'
Plug 'scrooloose/nerdcommenter'
Plug 'tomasr/molokai'
Plug 'jiangmiao/auto-pairs'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'fatih/vim-go',
Plug 'nvie/vim-flake8'
<script>
Notification.requestPermission().then(function(result) {
console.log(result);
});
var notify = function(message) {
// Let's check if the browser supports notifications
if (!("Notification" in window)) {
alert("This browser does not support system notifications");
}
@gabber12
gabber12 / main.py
Last active February 19, 2017 10:21
AWS resource leakage finder
import boto.ec2
from collections import defaultdict
regions = {region.name: region.name for region in boto.ec2.regions()}
class RegionPricingContext(object):
def __init__(self, region):
self.region = region
self.context = None
@gabber12
gabber12 / gist:06fb8f238bbaf43ae0fd08d2baa74b85
Created April 25, 2017 19:16
Simple JenkinsFile for testing
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building..'
}
}
stage('Test') {
steps {