Skip to content

Instantly share code, notes, and snippets.

View ivandeex's full-sized avatar
:octocat:
¯\_(ツ)_/¯ BUSY

Ivan Andreev ivandeex

:octocat:
¯\_(ツ)_/¯ BUSY
View GitHub Profile
@ivandeex
ivandeex / borg.py
Last active August 29, 2015 14:25
Python Borg vs singleton: we all are one and all that jazz -- http://code.activestate.com/recipes/66531/
class Borg:
__shared_state = {}
def __init__(self):
self.__dict__ = self.__shared_state
# and whatever else you want in your class -- that's all!
# Put in const.py...:
class _const:
class ConstError(TypeError):
pass
def __setattr__(self,name,value):
if self.__dict__.has_key(name):
raise self.ConstError, "Can't rebind const(%s)"%name
self.__dict__[name]=value
import sys
sys.modules[__name__]=_const()
@ivandeex
ivandeex / custom_kernel
Last active August 29, 2015 14:26 — forked from cpuguy83/custom_kernel
Boot Ubuntu with custom kernel on Digital Ocean
apt-get install kexec-tools
# Insert this at the top of /etc/init.d/rcS
if grep -qv ' kexeced$' /proc/cmdline ;then
kexec --load /vmlinuz --initrd=/initrd.img --append='root=LABEL=DOROOT kexeced' &&
mount -o ro,remount / &&
kexec -e
fi
# Then just use apt/dpkg to install whatever kernel you want, e.g. from http://kernel.ubuntu.com/~kernel-ppa/mainline/
@ivandeex
ivandeex / ps2svg.md
Last active February 24, 2016 13:08
Бесплатный скрипт для Photoshop: экспорт векторных слоев из PSD в SVG. https://habrahabr.ru/company/ua-hosting/blog/277673/

Бесплатный скрипт для Photoshop: экспорт векторных слоев из PSD в SVG

https://habrahabr.ru/company/ua-hosting/blog/277673/

Как использовать скрипт

  1. Скачать скрипт по инструкции, описанной ниже.
  2. Перетянуть в свою папку скриптов Photoshop («Adobe Photoshop/presets/scripts»).
  3. (ОПЦИОНАЛЬНО) Перейти в Photoshop и сделать для скрипта горячую клавишу «Edit» menu –> Keyboard Shortcuts и потом в File –> Scripts –> PS to SVG. Как вариант, можно выбрать сочетание из CMD+ALT+E.
  4. В файле PSD в конце векторных слоев, которые будут экспортироваться, нужно дописать префикс ".svg". Например, слой под названием “Sky” преобразуется в “Sky.svg”.
@ivandeex
ivandeex / index.html
Created April 26, 2016 17:48
flash table cell when mouse hovers it
<html><head><title>test0</title>
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/sprintf/src/sprintf.js"></script>
<style>
table {
border-collapse: collapse;
}
td {
border: 1px solid black;
transition: 0.1s ease-out;
<#
.SYNOPSIS
Create a new desktop wallpaper from various sources and optionally overlay some text.
.DESCRIPTION
The script can be run manually, at logon or even as a scheduled task to update the wallpaper regularly
Wallpaper sources include:
- A solid colour

Keybase proof

I hereby claim:

  • I am ivandeex on github.
  • I am ivandeex (https://keybase.io/ivandeex) on keybase.
  • I have a public key whose fingerprint is E5A3 B8ED 566D 0832 ABC6 8963 FD2D 747B 2D1A 4766

To claim this, I am signing this object:

@ivandeex
ivandeex / index.html
Created September 9, 2017 19:31
week 5 - activity 6 - scrolling body & hover
<div class="scroll-wrap">
<table class="tbody-scroll">
<thead>
<tr> <th>Name</th> <th>phone</th> <th>Abyrvalg</th> </tr>
</thead>
<tbody>
<tr> <td>AAAA</td> <td>323232</td> <td>Lorem ipsum and a very long cell text</td> </tr>
<tr> <td>BB</> <td>323232</td> <td>Dolor</td> </tr>
<tr> <td>CCC</> <td>3435656</td> <td>Sit amet</td> </tr>
<tr> <td>AAAA</td> <td>323232</td> <td>Lorem ipsum</td> </tr>
@ivandeex
ivandeex / flex-axes-and-properties.markdown
Created September 10, 2017 20:26
flex axes and properties
/**
* @typedef {Object} Person
* @property {String} login Идентификатор сотрудника.
* @property {Number} floor "Домашний" этаж сотрудника.
* @property {String} avatar Ссылка на аватар.
*/
/**
* @typedef {Object} Room
* @property {Number} id Идентификатор переговорки.