Skip to content

Instantly share code, notes, and snippets.

View mupkoo's full-sized avatar

Mirko Akov mupkoo

View GitHub Profile
class CrudController < ApplicationController
def status
# Do some action
end
end

DDOS Client info

Criminals have laid siege to our networks using what's called a distributed denial-of-service attack (DDoS) starting at #{time}. The goal is to make #{app}, and the rest of our services, unavailable by flooding the network with bogus requests, so nothing legitimate can come through. This attack was launched together with a blackmail attempt that sought to have us pay to avoid this assault.

Note that this attack targets the network link between our servers and the internet. All the data is safe and sound, but nobody is able to get to it as long as the attack is being successfully executed. This is like a bunch of people blocking the front door and not letting you into your house. The contents of your house are safe -- you just can’t get in until they get out of the way.

We're doing everything we can with the help of our network providers to mitigate this attack and halt the interruption of service. We're also contacting law enforcement to track down the criminals responsible. But in the m

@mupkoo
mupkoo / application_controller.rb
Created May 30, 2014 17:22
HTTP Auth for Rails
class ApplicationController < ActionController::Base
include HttpAuthConcern
# the rest of your code
end
@mupkoo
mupkoo / ember-belongsTo.js
Created June 10, 2014 17:12
EmberJS belongsTo
App.User = DS.Model.extend({
name: DS.belongsTo('name', { embedded: true }),
email: DS.attr('string')
});
App.Name = DS.Model.extend({
first: DS.attr('string'),
last: DS.attr('string')
});
@mupkoo
mupkoo / application.hbs
Last active August 29, 2015 14:02
Ember Notifications component
{{! Rest of the file is omited }}
<div class="notifications">
{{#each controllers.notifications.notifications}}
{{system-notification content=this}}
{{/each}}
</div>
{{! Rest of the file is omited }}
@mupkoo
mupkoo / line-numbers.js
Created June 24, 2014 07:26
PrismJS line numbers tweak for Ghost
Prism.hooks.add("after-highlight", function(e) {
var el = e.element,
t = el.parentNode;
// Add 'line-numbers' class to the parent
if (el.className.indexOf('line-numbers') !== -1) {
t.className = t.className + ' line-numbers';
}
// The rest of the plugin
@mupkoo
mupkoo / auth.js
Created September 2, 2014 14:18
app/initializers/auth.js
// app/initializers/auth.js
import AuthManager from 'ivry/lib/auth/manager';
export default {
name: 'auth',
initialize: function(container, app) {
var manager = AuthManager.create();
@mupkoo
mupkoo / console-error
Last active August 29, 2015 14:07
Ember Flash messages view
Uncaught TypeError: Cannot read property 'send' of undefined vendor.js:32923
@mupkoo
mupkoo / component.hbs
Created October 7, 2014 07:01
Double click
<div {{ bind-attr class="placeholderClass :value" }} {{ action "open" }}>
{{ preview }}
<i class="icon icon-down"></i>
</div>
{{#if opened}}
<div class="collection">
<div class="icon-input">
{{ input value=query class="form-control input-sm" id="custom-select-filter" }}
<i class="icon icon-search"></i>
@mupkoo
mupkoo / comment.js
Created November 5, 2014 12:44
Comment decorate User
import Ember from 'ember';
import UserController from 'app/controllers/user';
export default Ember.ObjectController.extend({
decorateUser: function () {
var self = this;
this.get('user').then(function (user) {
var controller = UserController.create({ model: user });