Skip to content

Instantly share code, notes, and snippets.

@eliza-abraham
eliza-abraham / AES256Cryptor.java
Created August 23, 2018 11:28 — forked from kientux/AES256Cryptor.java
Encrypt and decrypt AES-256 (in CryptoJS way)
/**
* Created by kientux on 3/20/15
*/
import android.util.Base64;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.Arrays;
@eliza-abraham
eliza-abraham / LICENSE
Last active August 29, 2015 14:27 — forked from ourmaninamsterdam/LICENSE
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@eliza-abraham
eliza-abraham / webonise_cyberoam_login.sh
Last active August 29, 2015 14:26 — forked from sharang-webonise/webonise_cyberoam_login.sh
This script connects you to the internet through Cyberoam
Replace NAME with your username and PASS with your password that you use to connect to Cyberoam.
Now add this script to your your crontab like so:
$ crontab -e
Add the following entry:
* * * * * /home/webonise/.shell_scripts/cron_jobs/webonise_cyberoam_login.sh
Replace the path with wherever the above mentioned script lies on your system.
The script will be executed every minute. It will check if you are connected to the Internet and if not it will connect you.
(function(ctx, $, undefined){
$(document).ready(function(){
bindEvent();
})
function bindEvent () {
//private scope for application
}
class BaseCreator < Creators::Base
EXTRA_PARAMS = [:action, :controller, :format,:utf8,:authenticity_token]
def initialize(raw_params, model)
super(raw_params,model)
end
def refine_params
@params.deep_symbolize_keys.delete_if{|k,v| EXTRA_PARAMS.include? k }
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Name=Sublime Text
GenericName=Text Editor
Comment=Sophisticated text editor for code, markup and prose
Exec=/opt/sublime_text_3/sublime_text %F
Icon=/opt/sublime_text_3/Icon/48x48/sublime-text.png
Terminal=false

Models, Roles, Decorators, and Interactions

A modest alternative to DCI that might be worth further thought

One of the problems with advancing the discussion on DCI is that we lack a comparable alternative pattern that has the same goals, but favors a low ceremony approach. The closest thing we have to that is Rails concerns, but they are more like distant relatives of the DCI concepts rather than first cousins, and that makes comparisions between the two approaches not especially fruitful.

I am considering the idea of experimenting with my own paradigm that captures the intent and purity of DCI, but with the convenience of concerns. Please note that this is just the starting point of a conversation, it is NOT a promise of comercially available cold fusion or a cure for cancer. It's just a gist with an idea on it I'd like to hear your thoughts on.

What if we had a top-level topology that was split into Models, **Rol

<virtualhost *:80>
ServerName app.com
ServerAlias www.app.com
DocumentRoot /var/www/html/blog/public # <-- be sure to point to 'public'!
setenv RAILS_ENV production
<Directory /var/www/html/blog/public>
AllowOverride All
RailsEnv production
</Directory
ErrorLog /var/log/apache2/blog_error_log
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8