Skip to content

Instantly share code, notes, and snippets.

@dreikanter
dreikanter / wishlist.md
Last active December 19, 2015 04:48
My Wishlist 2013
  • «Сила воли», Келли Макгонигалhttp://b23.ru/hm6s
  • «Искусство визуализации в бизнесе», Нейтан Яу → http://b23.ru/hm6e
  • «Позитивная иррациональность», Дэн Ариели → http://b23.ru/hmzu
  • «Естественный бег», Дэнни Эбшир и Брайан Метцлер → http://b23.ru/hmzt
  • «Рожденный бежать», Кристофер Макдугл → http://b23.ru/hm4n
  • «Стив Джобс», Уолтер Айзексонhttp://b23.ru/hm4l
  • «Бэтман Аполло», Виктор Пелевинhttp://b23.ru/hm46
  • Мобильное зарядное устройство (USB, на 5000+ mAh). Что-то типа такого: http://b23.ru/hm6j
  • Bluetooth аудио адаптерhttp://b23.ru/hm89
  • Европейский переходник для блока питания от макбука: http://b23.ru/hm8m
@dreikanter
dreikanter / strchr.py
Created July 8, 2013 16:58
Little trick to support both Python 2 an 3 dealing with string and char types
PY2 = sys.version_info[0] == 2
if not PY2:
strtype = str
chrtype = chr
else:
strtype = unicode
chrtype = unichr
@dreikanter
dreikanter / stopwatch.py
Created July 26, 2013 13:42
Measure elapsed time
import time
start_time = time.time()
time.sleep(1)
elapsed_time = time.time() - start_time
print(elapsed_time)
@dreikanter
dreikanter / UniqueSystemIdentifier.cs
Created October 16, 2013 14:12
Getting unique system ID
using System;
using System.Management;
namespace UniqueSystemIdentifier
{
class Program
{
private static string GetSystemID()
{
var search = new ManagementObjectSearcher(String.Format("SELECT * FROM Win32_Processor"));
@dreikanter
dreikanter / drop-exif.bat
Created December 23, 2013 13:13
Batch file to drop EXIF metadata for all *jpg files in current directory
for /r %%v in (*.jpg) do exiftool -all= -filename="%%~nv_clean%%~xv" "%%v"
@dreikanter
dreikanter / filmfeed.yml
Last active January 4, 2016 17:09
FilmFeed data exported to a YAML file. From now on data updates would be mirrored at http://drafts.cc/movies.html
- title: "August: Osage County"
release: 2013
date: "January 14, 2014"
status: "want"
comment:
- title: "Gravity"
release: 2013
date: "January 10, 2014"
status: "liked"
@dreikanter
dreikanter / README.md
Last active August 29, 2015 13:57
Fixed Cousera Downloader

This is quick and dirty fix for coursera-dl script. Put courseradownloader.py into site-packages and execute like this:

python -m courseradownloader -u [email protected] -p supersecret -d . behavioralecon-002
@dreikanter
dreikanter / s3-access-policy.json
Last active August 29, 2015 13:57
IAM user configuration to grant access to a specific bucket at Amazon S3
{
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "arn:aws:s3:::*"
},
{
"Effect": "Allow",
"Action": "s3:*",
@dreikanter
dreikanter / wishlist-2014.md
Last active August 29, 2015 14:02
My Wishlist 2014
@dreikanter
dreikanter / zend-tutorial-1.html
Last active April 13, 2017 20:01
Хабрапост 2007 года про Zend Framework — http://habrahabr.ru/post/31168/, http://habrahabr.ru/post/31173/
<b>Update (2014):</b> Это статья 2007 года, которая, к моему удивлению, до сих пор пользуется спросом. По этой причине я обновил её в соответствии с новыми правилами оформления постов на Хабре, и добавил подсветку синтаксиса для примеров кода. Если кому-то захочется что-то добавить или исправить, исходник текста с хабра-разметкой выложен в открытый доступ: https://gist.github.com/dreikanter/2b4ee996d7a775e707d7
<h4>Аннотация от переводчика</h4>
PHP — один из самых широко распространенных языков разработки веб-приложений и при этом один из самых спорных. Я очень часто видел негативное отношение к этой технологии, да и недостатки, провоцирующие это отношение — не для кого не являются секретом. Тем не менее, PHP активно эволюционирует и во многих отношениях постепенно становитс лучше. Одним из серьезных шагов его развития, на мой взгляд, является появление MVC-фреймворков, призванных систематизировать процесс разработки веб-приложений и приучить к порядку разработчиков, которым зачастую здорово не хватает силы