Skip to content

Instantly share code, notes, and snippets.

View unicolet's full-sized avatar

Umberto Nicoletti unicolet

View GitHub Profile
@cypres
cypres / zfs_report.sh
Created December 19, 2011 21:35
ZFS scripts
#!/bin/sh
echo "ZFS listing:"
/sbin/zfs list
echo
echo "ZFS compression ratio:"
/sbin/zfs get compressratio | /usr/bin/grep -v @
echo
@topherfangio
topherfangio / popup_example.js
Created June 17, 2011 16:01
Example of a popup using the popover theme
MyApp.myPopoverView = SC.PickerPane.create({
layout: { width: 300, height: 150 },
themeName: 'popover',
contentView: SC.WorkspaceView.extend({
topToolbar: null,
bottomToolbar: null,
contentView: SC.View.extend({
// in apps/your_app/core.js, add: require('ext/binding');
// place this in apps/your_app/ext/binding.js:
SC.mixin(SC.Binding, {
firstObject: function() {
return this.transform(function(value, isForward) {
if (value && value.isEnumerable) {
value = value.firstObject();
}
return value;
@alexissmirnov
alexissmirnov / main_page.js
Created August 10, 2010 17:48
SC.ScrollView around SC.StackedView
/*
This example shows how to use SC.StackedView with complex items.
The item view (List.ItemView) must use SC.StaticLayout mixin and
set useStaticLayout to YES -- that's a requirement of SC.StackedView.
Note that children views of List.ItemView also need to add SC.StaticLayout
and set useStaticLayout to YES. This setting doesn't preclude positioning
of child views within its block, by using layout's "left", "width"
*/
@jonraasch
jonraasch / jQuery.support-transition.js
Created April 21, 2010 14:32
Extends the jQuery.support object to CSS3 transition
// jQuery.support.transition
// to verify that CSS3 transition is supported (or any of its browser-specific implementations)
$.support.transition = (function(){
var thisBody = document.body || document.documentElement,
thisStyle = thisBody.style,
support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined;
return support;
})();
@ialexi
ialexi / view.js
Created March 29, 2010 16:48 — forked from rebo/gist:348079
nameValue: SC.LabelView.design({
layout: {
top: 30,
left: 125,
height: 24,
width: 200
},
valueBinding: "Training.operativesController.selection",
valueBindingDefault: SC.Binding.single() // when bindings are formed, it will use single() binding, which gets first object