Skip to content

Instantly share code, notes, and snippets.

View kitwalker12's full-sized avatar

Kunwar Aditya Raghuwanshi kitwalker12

View GitHub Profile
@kitwalker12
kitwalker12 / images.xml
Last active June 17, 2023 12:08
Amazon MWS Beauty Product Feed XML Sample
<?xml version="1.0" encoding="utf-8"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>AXXXXXXXXXX</MerchantIdentifier>
</Header>
<MessageType>ProductImage</MessageType>
<Message>
<MessageID>1</MessageID>
<OperationType>Update</OperationType>
@kitwalker12
kitwalker12 / project.md
Last active February 19, 2023 08:01
Rails Interview Project

Product Management Tool (Rails/JS)

Your task is to create a simple product management tool that lets you create products and search products in a listing page. You are required to use Ruby on Rails (>=5) and React/Vue/Ember for development.

Requirements

Your app will implement 3 models.

  • Product which contains the following attributes/validations:
    • name (string (0-1024 chars), unique)
    • upc (string (10,12 or 13 chars), unique, only numeric characters (0-9) allowed)
@kitwalker12
kitwalker12 / cookies.js
Created November 13, 2013 01:59
Set cookies based on referral links
// init namespace
window.app = {};
window.app.custom = {};
(function ($, app) {
var $window = $(window);
app.captureCampaign = {
parameters: ['campaign_source'],
cookiePersistDays: 30,
@kitwalker12
kitwalker12 / migrate-redis.py
Created March 4, 2017 00:11 — forked from thomasst/migrate-redis.py
Migrate Redis data on Amazon ElastiCache
"""
Copies all keys from the source Redis host to the destination Redis host.
Useful to migrate Redis instances where commands like SLAVEOF and MIGRATE are
restricted (e.g. on Amazon ElastiCache).
The script scans through the keyspace of the given database number and uses
a pipeline of DUMP and RESTORE commands to migrate the keys.
Requires Redis 2.8.0 or higher.
@kitwalker12
kitwalker12 / Dockerfile
Last active February 21, 2020 16:14
docker splunk forwarder
FROM ubuntu:trusty
# make the "en_US.UTF-8" locale so splunk will be utf-8 enabled by default
RUN apt-get update && apt-get install -y locales wget \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
#Install Splunk
RUN wget -qO splunkforwarder.deb http://download.splunk.com/releases/6.2.3/universalforwarder/linux/splunkforwarder-6.2.3-264376-linux-2.6-amd64.deb -o splunkforwarder.deb \
&& dpkg -i splunkforwarder.deb \
&& rm splunkforwarder.deb
@kitwalker12
kitwalker12 / game_of_life.java
Last active January 28, 2020 00:20
Game of Life Boilerplate
public class GameOfLife {
GameOfLife() { // state may be passed here
}
public void evolve {
}
public void print {
}
}
class MyLogger < ActiveSupport::TaggedLogging
def initialize(logger)
super(logger)
logger.formatter = formatter
end
def formatter
Proc.new{|severity, time, progname, msg|
formatted_time = time.strftime("%Y-%m-%d %H:%M:%S")
{

Keybase proof

I hereby claim:

  • I am kitwalker12 on github.
  • I am adi_r (https://keybase.io/adi_r) on keybase.
  • I have a public key ASDNzGWok7brUk7Imh3wXz09gq6basjAZT0BcWiHzY9mLgo

To claim this, I am signing this object:

def progname; "Dis-organizer"; end
module DisOrganizer
def version; "Mark 7"; end
end
class CoffeeEnabled
def service_inquiry
"order you a coffee"
end
@kitwalker12
kitwalker12 / rake_file_list.rb
Created August 1, 2018 05:12
Rake File Lists
source_files = Rake::FileList.new("**/*.md", "**/*.markdown") do |fl|
fl.exclude("~*")
fl.exclude(/^scratch\//)
fl.exclude do |f|
`git ls-files #{f}`.empty?
end
end
task :default => :html
task :html => source_files.ext(".html")