Skip to content

Instantly share code, notes, and snippets.

@GoSteven
GoSteven / macsetup.md
Last active December 6, 2019 05:26
New Mac
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install htop
brew cask install pycharm
brew cask install intellij-idea
brew cask install google-chrome
brew cask install anaconda
brew install bash

@GoSteven
GoSteven / wmctl.md
Last active August 29, 2015 14:16
wmctl custom gnome shortcut

maximise current window

wmctrl -r :ACTIVE: -e 0,25,50,2100,1500 

switch to tmux

bash -c 'if wmctrl -l | grep -q "^[^ ]\+  0 [^ ]\+ tmux"; then wmctrl -r "tmux" -t 1; else wmctrl -R "tmux"; fi'
@GoSteven
GoSteven / tmux.conf
Created March 1, 2015 23:23
tmux.conf
set-option -g default-shell /bin/zsh
# Support for 256 colors
set-option -g default-terminal "screen-256color"
# bind vi key-mapping
set-option -g status-keys vi
# vi-style controls for copy mode
set-window-option -g mode-keys vi
# large history
set-option -g history-limit 100000
@GoSteven
GoSteven / vimrc
Last active August 29, 2015 14:16
Vimrc
set nocompatible
filetype off
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Vundle https://github.com/gmarik/Vundle.vim
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
@GoSteven
GoSteven / scrape_abc_movies_review.py
Last active August 29, 2015 14:04
scrape_abc_movies_review.py
from BeautifulSoup import BeautifulSoup
import requests
import os
import re
import peewee
from peewee import *
db = MySQLDatabase('movies',host="localhost",user='root')
db.connect()
class Movie(peewee.Model):
#!/bin/bash
# virtualenv-auto-activate.sh
#
# Installation:
# Add this line to your .bashrc or .bash-profile:
#
# source /path/to/virtualenv-auto-activate.sh
#
# Go to your project folder, run "virtualenv .venv", so your project folder
# has a .venv folder at the top level, next to your version control directory.
java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
@GoSteven
GoSteven / changeMvnPassword.sh
Created December 4, 2012 01:22
Change maven encripted password in ~/.m2/settings.xml
#!/bin/bash
echo Please type your password:
read -s p
encrypted=`mvn --encrypt-password $p`
echo encrypted password for mvn is:
echo $encrypted
#escape /
encrypted=`echo "$encrypted" | sed s,/,\\\\\\\\\\/,g`
@GoSteven
GoSteven / algorithm_and_data_structure.md
Created June 23, 2012 11:48
algorithm and data structure

ant colony

Thus, when one ant finds a good (i.e., short) path from the colony to a food source, other ants are more likely to follow that path, and positive feedback eventually leads all the ants following a single path. The idea of the ant colony algorithm is to mimic this behavior with "simulated ants" walking around the graph representing the problem to solve.


List of algorithms

RECITE

Gateways

  • Inclusive Gateway -- merging Inclusive Gateway
    decisions may produce more that one possible outcome
  • Parallel Gateways
  • Exclusive Gateway