Skip to content

Instantly share code, notes, and snippets.

View indrode's full-sized avatar
👻

Indro De indrode

👻
  • Cologne, Germany
View GitHub Profile
# gem 'aws-sdk', '~> 2'
# Aws.config.update(region: 'eu-central-1', credentials: Aws::Credentials.new(ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']))
# s3 = Aws::S3::Client.new
class S3OwnerPics
BUCKET_PREFIX = ''
attr_reader :property
def initialize(property)
@indrode
indrode / sinatra-logging.rb
Created July 21, 2015 09:20
Simple Sinatra logging to file.
# simple Sinatra logging to file
require 'sinatra'
require 'logger'
configure do
LOGGER = Logger.new("some.log")
enable :logging, :dump_errors
set :raise_errors, true
end
@indrode
indrode / Preference.sublime-settings
Last active August 29, 2015 14:23
My Sublime Text settings
{
"auto_complete_with_fields": true,
"color_scheme": "Packages/Theme - Afterglow/Afterglow.tmTheme",
"detect_slow_plugins": false,
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"font_face": "Source Code Pro",
"font_size": 10.0,
"highlight_line": true,
"ignored_packages": [ "Vintage" ],

Keybase proof

I hereby claim:

  • I am indrode on github.
  • I am indro (https://keybase.io/indro) on keybase.
  • I have a public key whose fingerprint is 48FB 7F84 E087 05D3 EB0D DD86 1837 4481 66CB 27D7

To claim this, I am signing this object:

#!/bin/sh
# Edited osx-for-hackers.sh by Indro De
# forked from brandonb927/osx-for-hackers.sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
red='\033[0;31m'

Keybase proof

I hereby claim:

  • I am indrode on github.
  • I am indro (https://keybase.io/indro) on keybase.
  • I have a public key whose fingerprint is 88B9 30C8 1939 89D1 C06A 4633 6B81 897D B65F 85B8

To claim this, I am signing this object:

@indrode
indrode / gist:9a7bc0048827002e691b
Last active August 29, 2015 14:04
Changing product streaming rights.
p = Product.find(id)
# to get the current rights string
p.tracks.first.new_track_rights.rights
# edit this string
rights = "WW99999999-99999999|ZA20140101-99999999|NG20140101-99999999"
p.tracks.each do |t|
n = t.new_track_rights
@indrode
indrode / gist:cc465337e5925759b562
Last active August 29, 2015 14:04
Taking an offline-album back online.
album = Product.find(629639)
album.tracks.each do |t|
t.taken_offline = false
t.save
end
album.taken_offline = false
album.save
album.update_ati!
# run on ES host
ids.each do |product_id|
p = Product.find(product_id)
p.tracks.map(&:id).each do |id|
command = "curl -XDELETE 'http://localhost:9200/tracks_production/umg_ddex_track/#{id}'"
system(command)
end
command = "curl -XDELETE 'http://localhost:9200/products_production/umg_ddex_album/#{product_id}'"
system(command)
end
@indrode
indrode / gist:1dbe8143fb1afab194dc
Last active August 29, 2015 14:03
Remap products via XMLs
def remap_kontor_za!(filename)
arr = read_ids_from_file(filename)
arr.each do |id|
album = KontorZaAlbum.find_by_id(id)
if album
c = ContentManager.new(album)
attrs = c.attributes
ContentManager.update_product_from_overwrite_mapping_attributes(album, attrs)
print '.'.green
else