Skip to content

Instantly share code, notes, and snippets.

View unicolet's full-sized avatar

Umberto Nicoletti unicolet

View GitHub Profile
@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
@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;
})();
@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"
*/
// 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;
@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({
@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
If you have ruby-1.9.2, good. I used rvm, and did a recent install with
rvm install ruby-1.9.2
rvm --default use 1.9.2
Then to the SproutCore parts:
gem install sproutcore [The console output indicated SproutCore 1.6]
cd to your dev area, e.g. .../Development/sproutcore
@bsstoner
bsstoner / http.js
Created May 21, 2012 03:30
support helper for doing http tests with mocha
/**
* Modified version of TJ's http support file from the Express repo:
* https://github.com/visionmedia/express/blob/master/test/support/http.js
*
* Module dependencies.
*/
var EventEmitter = require('events').EventEmitter
, should = require('should')
, methods = ['get','post','put','delete','head']
@lusis
lusis / opsschool.md
Created October 25, 2012 12:48
What happened here?

Random idea

I'm a big fan of the Ops School idea. I've struggled for years about how to "train up" someone coming into this field. So much of our skill set is forged in the fire of outages and troubleshooting.

One of the things that is both good and bad about system administration and operations is that we tend to see patterns. It's good in that we immediately see things that stand out. The downside is we tend to superimpose that pattern recognition in inappropriate ways.

We had an interesting issue happen yesterday at the dayjob. I won't go into exactly what it was here but I had an idea based on some graphs I was looking at. It's part social experiment but it's also part problem solving skills.

Given the following image with no context, what do you think happened? What are some of the key indicator points that jump out and what pattern do they call to mind?

_(Since it may not be clear simply from an image resolution perspective, there are 4 me

@akoumjian
akoumjian / salt_masterless_quickstart.rst
Created December 7, 2012 23:26
Salt Masterless Quickstart Guide

Salt Masterless Quickstart

Running a masterless salt-minion lets you use salt's configuration management for a single machine. It is also useful for testing out state trees before