Skip to content

Instantly share code, notes, and snippets.

View igorcoding's full-sized avatar
🍹
Having fun

Igor Latkin igorcoding

🍹
Having fun
View GitHub Profile
@igorcoding
igorcoding / series_analyser.py
Created April 18, 2015 19:00
Some time series analysing
from pprint import pprint
import math
from scipy.optimize import curve_fit
import numpy as np
import matplotlib.pyplot as plt
import pylab
import scipy.stats as stats
import sklearn.linear_model
@igorcoding
igorcoding / batch_rename.sh
Created January 11, 2015 20:28
Batch rename
#! /bin/bash
SRC=$1
DEST=$2
i=1
for ph in ${SRC}/*; do
filename=$(basename "$ph")
ext="${filename##*.}"
new_filename="${i}.${ext}"
#echo $new_filename
<!doctype html>
<html>
<head>
<title>Socket.IO chat</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font: 13px Helvetica, Arial; }
form { background: #000; padding: 3px; position: fixed; bottom: 0; width: 100%; }
form input { border: 0; padding: 10px; width: 90%; margin-right: .5%; }
form button { width: 9%; background: rgb(130, 224, 255); border: none; padding: 10px; }
import datetime
import json
import requests
from random_words import *
import random
import MySQLdb
import MySQLdb.cursors
users = []
forums = []
@igorcoding
igorcoding / apache_log_parse.py
Created January 29, 2014 16:03
Apache access log file regex parsing
import re
from pprint import pprint
def parse_request(request_str):
pattern = re.compile(r"""(?P<method>.*)\s # method, space
(?P<url>.*)\s # url, space
(?P<protocol>.*) # protocol
""", re.VERBOSE)
match = pattern.match(request_str)