Skip to content

Instantly share code, notes, and snippets.

@asqd
asqd / custom-rest-mixin.js.coffee
Created January 26, 2015 13:12
Ember Custom REST actions mixin
# Provides custom REST actions in your application
#
# For example:
# We need to update rating of current post using action /posts/:id/voite
#
# Extend your model with mixin
# App.Post = DS.Model.extend App.CustomRestMixin,
#
# Then in Post controller you can use custom REST actions
#
@asqd
asqd / README.md
Last active August 29, 2015 14:14
Ember Pikaday Component + PikadayJS and Pikaday CSS

Ember Pikaday Component

Usage

{{pikaday-input value=yourDateField}}

Configuration

You can change the default format from "DD.MM.YYYY" to any format string supported by Moment.js

# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to make opened Markdown files always be soft wrapped:
#
# path = require 'path'
#
@asqd
asqd / README.md
Last active August 29, 2015 14:18
Ember PickADate Component

Ember PickADate Component Ember Component for pickadate.js

Usage

{{pick-a-date value=yourDateField}}

{
"name": "frontend",
"version": "0.0.0",
"description": "Small description for frontend goes here",
"private": true,
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
@asqd
asqd / redis_helper.rb
Created February 29, 2016 14:43
Redis helper mixin for rails
module RedisHelper
REDIS = Redis.current
def self.fetch(key, options={}, &block)
val = get_val(key, options) if REDIS.exists(key)
unless val && block_given?
val = yield
set_val(key, val, options)
end
@asqd
asqd / # emacs - 2016-05-14_01-17-28.txt
Created May 13, 2016 22:21
emacs on Mac OS X 10.11.4 - Homebrew build logs
Homebrew build logs for emacs on Mac OS X 10.11.4
Build date: 2016-05-14 01:17:28
@asqd
asqd / log_parser.py
Last active December 18, 2016 11:32
import json
import datetime
def humanize_time(time, units):
INTERVALS = [1, 60, 3600, 86400, 604800, 2419200, 29030400]
NAMES = [('second', 'seconds'),
('minute', 'minutes'),
('hour', 'hours'),
('day', 'days'),
('week', 'weeks'),
<MassUploadRequest xmlns="http://assis.ru/ws/api" timestamp="1497395593">
<object externalId="705091" publish="true">
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="OfficeRentRequestType">
<common name="" description="Без комиссии. Оперативный показ! Вашему вниманию предлагается помещение в офисном центре Скайпоинт класса A, здание расположено по адресу шоссе Международное 28с1, доступность до ближайшей станции метро Планерная составит 136 минут пешком. Помещение расположено на 3 этаже, общей площадью 155 кв.м. Номер налоговой 7743. В помещении стандартная офисная отделка, кабинетная планировка. НДС не включен в ставку. Коммунальные платежи и интернет не включены в стоимость аренды. На фото представлены общие фотографии центра. " ownership="AGENT" price="180833" currency="RUR" districtId="1" subDistrictId="1" distanceToMetro="1" distanceType="WALK" square="155.0" externalId="705091" commission="0" commissionType="PERCENT">
<address>
<coordinates lat="55.947853" lon="37.41149"/>
</add
@asqd
asqd / yii.md
Last active October 9, 2017 11:48
yii-tutorial Raw

Yii Guide

OSX

Установка Apache и PHP

Устанавливаем Apache

В OSX 10.12 Sierra уже установлен Apache 2.4, но в нем может не хватать некоторых скриптов. По этому лучше переустановить apache через homebrew. Обновляем brew