Skip to content

Instantly share code, notes, and snippets.

(function() {
'use strict';
angular
.module('loanDoxApp')
.controller('DocumentDialogController', DocumentDialogController);
DocumentDialogController.$inject = ['$timeout', '$scope', '$stateParams', '$uibModalInstance', 'entity', 'Document', 'Exam'];
function DocumentDialogController ($timeout, $scope, $stateParams, $uibModalInstance, entity, Document, Exam) {
$scope.schema = {
"type": "object",
"title": "Comment",
"properties": {
"picture": {
"title": "Picture",
"type" : "object"
},
"email": {
"title": "Email",
@binnyg
binnyg / app.js
Last active August 29, 2015 14:16
formlyConfigProvider.setType({
name: 'fileField',
template: '<input ng-file-select ng-model="model[options.key]" type="file">',
wrapper: ['bootstrapLabel', 'bootstrapHasError']
});
class Domain < ActiveRecord::Base
belongs_to :user
attr_accessible :name
# Validation
validates :name, :presence => true
validates :name, :uniqueness => { :scope => self.user.id,
:message => "Domain already added to your account" }
end
@binnyg
binnyg / gemfile
Created September 22, 2012 22:35
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
gem 'thin'
end
class Comment < ActiveRecord::Base
attr_accessible :invitation_id, :comment
belongs_to :invitation
end
Models
----------------------------------------
Invitation
has_many :comments
Comment
belongs_to :invitation
Controller
CREATE EXTERNAL TABLE domain_name_export_hdfs (
dn string, td string, h int, r bigint, g string
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '|'
location 'hdfs://namenode:9001/hadoop/data/201204/';
@binnyg
binnyg / gist:2413100
Created April 18, 2012 11:54
YUI overlay+scrollview
<html>
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<title>TEst</title>
<script src="http://yui.yahooapis.com/3.5.0/build/yui/yui-min.js"></script>
<STYLE TYPE="text/css" MEDIA=screen>
.yui3-overlay-content {
box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.25);
background: none repeat scroll 0 0 rgba(82, 82, 82, 0.7);
border-radius: 7px;
@binnyg
binnyg / gist:2352798
Created April 10, 2012 16:47
popup-calendar
YUI_config = {
filter: "raw",
groups: {
gallery: {
combine: false,
debug: true,
filter: "raw",
base: "/invitation/js/",
patterns: {
"gallery-": {},