Skip to content

Instantly share code, notes, and snippets.

@andreipak
andreipak / responsive-sticky-footer.css
Created November 30, 2017 03:04 — forked from seyDoggy/responsive-sticky-footer.css
Responsive sticky footer for bootstrap
@andreipak
andreipak / vkcom_audio_download.py
Created November 7, 2015 06:21 — forked from st4lk/vkcom_audio_download.py
Python: vkontakte.ru (vk.com) audio music downloader
# -*- coding: utf-8 -*-
"""
Скрипт для скачивания музыки с сайта vkontakte.ru (vk.com)
Запуск:
python vkcom_audio_download.py
Принцип работы:
Скрипт проверяет сохраненный access_token. Если его нет или срок истек,
то открывается страница в браузере с запросом на доступ к аккаунту.
@andreipak
andreipak / setup-vmware-image-with-static-IP.markdown
Created October 8, 2015 16:11 — forked from pjkelly/setup-vmware-image-with-static-IP.markdown
VMWare Fusion Images with a static IP Address on Mac OS X Snow Leopard

How to setup your VMWare Fusion images to use static IP addresses on Mac OS X

At Crush + Lovely, we use Railsmachine's Moonshine to automate the configuration of our servers. When writing our deployment recipes, VMWare Fusion's ability to take snapshots and rollback to these snapshots is a huge timesaver because it takes just seconds to roll a server image to it's original state.

When you're just configuring a single server, having a static IP address for your server image isn't too important, but when you're configuring multi-server setups, it can be useful to duplicate a number of server images and give each a static IP address so you can consistently deploy to them. While not documented well at all, it turns out that this is relatively easy to accomplish in four simple steps.

1. Determine the MAC address of your guest machine

Let's say you have a guest machine with the name ubuntu-lucid-lynx-base a

@andreipak
andreipak / GIF-Screencast-OSX.md
Created October 8, 2015 13:29 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

End of Line Character Test
Which do you like CR LF or LF?
This file uses "CR LF"!!!!
Clone me!
@andreipak
andreipak / server.py
Last active August 29, 2015 14:16 — forked from tsuna/server.py
#!/usr/bin/python
# A simple example of a threaded TCP server in Python.
#
# Copyright (c) 2012 Benoit Sigoure All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright notice,
@andreipak
andreipak / .zshrc
Last active August 29, 2015 14:16 — forked from aurbano/.zshrc
# start_time="$(date +%s)"
# Antigen — A zsh plugin manager
export ANTIGEN_DEFAULT_REPO_URL=https://github.com/sharat87/oh-my-zsh.git
source ~/antigen.zsh
# Load the oh-my-zsh's library.
antigen use oh-my-zsh
# Bundles from the default repo declared above.
user www-data;
# As a thumb rule: One per CPU. If you are serving a large amount
# of static files, which requires blocking disk reads, you may want
# to increase this from the number of cpu_cores available on your
# system.
#
# The maximum number of connections for Nginx is calculated by:
# max_clients = worker_processes * worker_connections
worker_processes 1;
"""
Settings for root logger.
Log messages will be printed to console and also to log file (rotated, with
specified size). All log messages from used libraries will be also handled.
Three approaches for defining logging settings are used:
1. using logging classes directly (py25+, py30+)
2. using fileConfig (py26+, py30+)
3. using dictConfig (py27+, py32+)
Choose any variant as you like, but keep in mind python versions, that