Skip to content

Instantly share code, notes, and snippets.

import com.fasterxml.jackson.annotation.JsonCreator;
import test.protobuf.Test;
public class Wrapper {
public Test.Foo foo;
@JsonCreator
public Wrapper(Test.Foo foo) {
this.foo = foo;
}
@skizzybiz
skizzybiz / .bash_profile
Created September 26, 2012 17:17
Multiline Bash command prompt with user, host, path, git status, right-aligned timestamp.
# Define colors
RESET='\[\033[00m\]'
FGBK='\[\033[0;30m\]' # foreground black
FGRD='\[\033[0;31m\]' # foreground red
FGGN='\[\033[0;32m\]' # foreground green
FGYL='\[\033[0;33m\]' # foreground yellow
FGBL='\[\033[0;34m\]' # foreground blue
FGMG='\[\033[0;35m\]' # foreground magenta
FGCY='\[\033[0;36m\]' # foreground cyan
FGGR='\[\033[0;37m\]' # foreground gray
@skizzybiz
skizzybiz / console.js
Created September 21, 2011 18:33
Observers for sub-properties don't work when using notifyPropertyChange
X.b.get('prop') // => 0
X.b.setA(X.o)
X.b.get('prop') // => 0
X.b.get('a').get('prop') // => 1
X.b.notifyPropertyChange('prop')
X.b.get('prop') // => 1
@skizzybiz
skizzybiz / app.rb
Created June 2, 2011 21:01
Problems with AR.find
class MainDB::App < ActiveRecord::Base
establish_connection :main_db
set_table_name "APPLICATIONS"
end
@skizzybiz
skizzybiz / nomination_model.js
Created May 24, 2011 23:56
Record relations
Authoring.ReportTemplate = SC.Record.extend({
// Attributes defined ...
nominations: SC.Record.toMany('Authoring.Nomination', {
isMaster: YES,
inverse: 'reportTemplate'
}),
clone: function() {
var attributes, clone;
attributes = {};
sc_require('models/base_model');
Authoring.Nomination = Authoring.BaseWithTimestamps.extend({
// ...
reportTemplate: SC.Record.toOne('Authoring.ReportTemplate', {
isMaster: NO,
key: "report_template_id",
inverse: "nominations"
}),
// ...
});
@skizzybiz
skizzybiz / my_page.js
Created May 16, 2011 15:07
SelectFieldView not working
// ...
stateSelect: SC.SelectFieldView.design({
layout: {
left: 120,
height: 18,
centerY: 0
},
objectsBinding: '.parentView*content.record.internalStateOptions',
nameKey: 'label',
valueKey: 'value',
@skizzybiz
skizzybiz / grouped_nominations.js
Created May 13, 2011 15:58
Report Approval/Nomination
Authoring.groupedNominationsController = SC.TreeController.create({
content: null,
selection: null,
treeItemIsGrouped: YES,
setNominations: function(nominations) {
var group, osVersion, osVersions, root;
root = SC.Object.create({
treeItemChildren: []
treeItemIsExpanded: YES
contentView: SC.SourceListView.design({
contentBinding: 'Authoring.reportTemplatesArrayController.content',
selectionBinding: 'Authoring.reportTemplatesArrayController.selection',
exampleView: SC.View.design({
classNames: 'sc-list-item-view'.w(),
childViews: 'nameLabel'.w(),
nameLabel: SC.LabelView.design({
layout: { left: 10, width: 100, height: 18 },
valueBinding: '.parentView*content.name'
})
MT.ReportTemplateContainerView = SC.ContainerView.extend({
contentView: SC.TemplateView.extend({
itemBinding: 'MT.reportTemplates.selectedItem',
templateName: 'report_template_show'
}),
editView: SC.TemplateView.extend({
itemBinding: 'MT.reportTemplates.selectedItem',
templateName: 'report_template_edit'
})
});