Skip to content

Instantly share code, notes, and snippets.

View SlyDen's full-sized avatar

Denys Slipetskyy SlyDen

  • Lviv, Ukraine
View GitHub Profile
package test;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext-test.xml" })
@SlyDen
SlyDen / ConditionalIgnoreRule
Last active April 6, 2020 05:26 — forked from rherrmann/ConditionalIgnoreRule
Originally form here: JUnit rule to conditionally ignore test cases (see also http://www.codeaffine.com/2013/11/18/a-junit-rule-to-conditionally-ignore-tests/)
/*******************************************************************************
* Copyright (c) 2013,2014 Rüdiger Herrmann
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Rüdiger Herrmann - initial API and implementation
* Matt Morrissette - allow to use non-static inner IgnoreConditions
/**
* @class pdfView
* @extends {Ember.View}
*/
var PDFView = Ember.View.extend({
tagName: 'canvas',
/**
* Url to pdf file.
* @property src
* @type {string}
package com.johannesbrodwall.infrastructure;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
@SlyDen
SlyDen / Dockerfile
Last active August 29, 2015 14:19 — forked from dustin/Dockerfile
FROM ubuntu
MAINTAINER Dustin Sallings "dustin@spy.net"
ADD http://cbfs-ext.hq.couchbase.com/couchbase-dist/couchbase-server-enterprise_2.2.0_x86_64.deb /tmp/couchbase-server-enterprise_2.2.0_x86_64.deb
RUN apt-get update
RUN apt-get install -y librtmp0 python-httplib2
RUN dpkg -i /tmp/couchbase-server-enterprise_2.2.0_x86_64.deb
RUN rm /tmp/couchbase-server-enterprise_2.2.0_x86_64.deb
RUN /etc/init.d/couchbase-server stop
@SlyDen
SlyDen / GitHub curl.sh
Created November 24, 2015 11:46 — forked from Integralist/GitHub curl.sh
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
--location https://api.github.com/repos/owner/repo/contents/path
# Example...
TOKEN="INSERTACCESSTOKENHERE"
OWNER="BBC-News"
REPO="responsive-news"
@SlyDen
SlyDen / encrypt_data_bag.rb
Last active December 9, 2015 10:34 — forked from kcd83/encrypt_data_bag.rb
Standalone script for encrypting a json file data bag into an encrypted data bag for opscode chef .
#!/usr/bin/env ruby
if ARGV.length < 2
puts "usage: #{$0} databag.json new_encrypted_databag.json [encrypted_data_bag_secret]"
exit(1)
end
databag_file = ARGV[0]
out_file = ARGV[1]
if ARGV.length >= 3
@SlyDen
SlyDen / example-gunicorn-log.conf
Created December 17, 2015 15:50 — forked from fkei/example-gunicorn-log.conf
example gunicorn log config
[loggers]
keys=root,example.default,gunicorn.access,gunicorn.error
[logger_root]
level=DEBUG
handlers=example
[logger_example.default]
level=DEBUG
handlers=example
#!/bin/bash
# Allow toggling components to install and update based off flags
updateconsul=1
updatedocker=1
updatedockermachine=1
updatedockercompose=1
updatedockerswarm=1
consulversion="0.5.2"
@SlyDen
SlyDen / auth_views.py
Created January 28, 2016 11:23 — forked from scott2b/auth_views.py
login override for whitelisting/blacklisting and new-user forwarding for use with pyramid_persona
from pyramid.view import view_config
from pyramid.security import remember
from pyramid.security import authenticated_userid
from pyramid_persona.views import verify_login
USE_WHITELIST = False
WHITELIST_REJECT_MESSAGE = 'Sorry, you are not authorized to access this site.'
WHITELIST_REJECT_REDIRECT = '/'
USE_BLACKLIST = False
BLACKLIST_REJECT_MESSAGE = 'Sorry, you are not authorized to access this site.'