Skip to content

Instantly share code, notes, and snippets.

View arion's full-sized avatar

Abushaev Denis arion

View GitHub Profile
@arion
arion / gist:0a4134dd531b4db4d839
Created February 20, 2016 10:03
All Yabeam current mails
// Can't start campaign
Dear Publisher
We can't start your Campaign `Campaign Name (this is link)`.
The reason is: `#{@reason}`
For more information please visit your Dashboard(this is link).
@arion
arion / deploy.rb
Last active February 18, 2016 05:36
Clear assets for update I18n-js cache
namespace :deploy do
desc 'Clobber expired assets'
task clobber_assets: [:set_rails_env] do
on release_roles(fetch(:assets_roles)) do
within release_path do
with rails_env: fetch(:rails_env) do
execute :rake, "assets:clobber"
end
end
end
deploy@demo:~/rails_apps/store/current$ ps -aux | grep scheduler
deploy 2828 45.7 1.7 457224 134828 ? Rl May08 3153:34 resque-scheduler-2.0.0: Schedules Loaded
deploy 3520 0.0 1.8 458252 138264 ? Rl May08 1:43 resque-scheduler-2.0.0: Schedules Loaded
deploy 3637 45.4 1.7 458092 135732 ? Rl May08 3135:18 resque-scheduler-2.0.0: Schedules Loaded
deploy 7567 0.0 1.8 457440 137644 ? Rl May08 1:43 resque-scheduler-2.0.0: Schedules Loaded
deploy 7675 30.3 1.7 458100 135696 ? Rl May08 2084:53 resque-scheduler-2.0.0: Schedules Loaded
deploy 10954 37.2 1.7 456664 134424 ? Rl May09 2076:05 resque-scheduler-2.0.0: Schedules Loaded
deploy 11864 0.0 1.7 456908 137020 ? Rl May09 1:31 resque-scheduler-2.0.0: Schedules Loaded
deploy 12031 11.6 1.7 457692 135328 ? Rl May09 644:54 resque-scheduler-2.0.0: Schedules Loaded
deploy 13333 0.0 1.8 458168 138008 ? Rl May12 0:57 resque-scheduler-2.0.0: Schedules Loaded
curl -XGET http://localhost:9200/store_development_products/_search -d '
{
"aggs": {
"category_ids": {
"terms": {
"field": "root_category_ids",
"size": 1000
},
"aggs" : {
"by_product_type": {
params = {
"root_elements_without_brackets"=>[
{"key"=>"value1"},
{"key"=>"value2"},
],
"root_elements[]"=>[
{"key"=>"value1"},
{"key"=>"value2"},
],
"resource" => {
Started POST "/api/publish/v1/chapters" for ::ffff:10.249.92.53 at 2013-12-07 07:01:35 +0000
Processing by Api::Publish::V1::ChaptersController#create as HTML
Parameters: {"publisher_account_id"=>"31", "chapter"=>{"isbn"=>"C000000067293", "book_print_isbn"=>"B000000016251", "position"=>"5", "street_date"=>"", "title"=>"Java API", "tag_list"=>"", "formats"=>[{"isbn_13"=>"", "sku"=>"C000000067293", "remote_data_url"=>"https://slicebooks-production.s3.amazonaws.com/chapter/data/67293/B000000016251CH05.pdf?AWSAccessKeyId=AKIAJDZHQIDUVBX6XJPA&Expires=1387004380&Signature=89t7SSyu8rPA%2Fihnn7UGIWty2YM%3D", "price_cents"=>"0", "format"=>"pdf", "callback_url"=>"https://test.slicebooks.com/api/publication/a9e2ae5ef5011290643b4f9e", "remote_data_updated_at"=>"2013-12-07 00:29:29 -0600"}]}}
Rendered text template (0.0ms)
Completed 201 Created in 188911ms (Views: 0.9ms | ActiveRecord: 186313.6ms)
Started POST "/api/publish/v1/chapters" for ::ffff:10.250.76.18 at 2013-12-07 07:01:35 +0000
Rendered text template (0.0
# rTorrent configuration by meArion
# last updated on 09/11-13
## connection
# set peers limit
min_peers = 1
max_peers = 100
# set a port range
@arion
arion / inherited_properties.rb
Last active December 25, 2015 13:59
created by http://mediumexposure.com/multiple-table-inheritance-active-record/ with some modifications For use add to your model: include InheritedProperties inherits_properties_from 'SomePropertiesClass'
module InheritedProperties
extend ActiveSupport::Concern
included do
end
def properties_with_autobuild
properties_without_autobuild || build_properties
end
@arion
arion / imo_im_userscript.js
Created March 26, 2013 06:03
IMO.IM userscript for fluid
window.fluid.dockBadge = 0;
setTimeout(updateDockBadge, 500);
setInterval(updateDockBadge, 1000);
function updateDockBadge() {
var elements = document.querySelectorAll(".attention-bubble>span");
var element;
var sumNotice = 0;
@arion
arion / importfm.rb
Created August 20, 2012 12:46
scrobble all you local files to last.fm
# -*- encoding : utf-8 -*-
require "mp3info"
require "rockstar"
require "pry"
IMPORT_DIR = '/Users/arion/Music'
Rockstar.lastfm = YAML.load_file('lastfm.yml')
a = Rockstar::Auth.new
token = a.token