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
@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;
@ferventcoder
ferventcoder / chocolateyInstall.ps1
Last active September 11, 2015 07:15
MSI package
$ErrorActionPreference = 'Stop';
$packageArgs = @{
packageName = '[[PackageName]]'
unzipLocation = $toolsDir
fileType = 'MSI'
url = '[[Url]]'
url64bit = '[[Url64]]' # 64bit URL here or remove - if installer is both, use $url
silentArgs = "/qn /norestart"
validExitCodes= @(0, 3010, 1641)
@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({
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
@dasjoe
dasjoe / microbench.fio
Last active October 2, 2015 04:59
Useful fio microbenchmarks
; global parameters
[global]
fallocate=none
directory=/tank/bench
bs=4k-128k
size=16g
end_fsync=1
loops=1
rwmixread=70
;buffer_compress_percentage=0
@mattweber
mattweber / README
Last active December 13, 2015 22:19
Using ElasticSearch To Find The Best Time To Ask Questions on StackOverflow
Use extractDocs.py to parse and index the StackOverflow posts.xml file into an existing index.
Usage: extractDocs.py [options] file
Options:
-h, --help show this help message and exit
-s SERVER, --server=SERVER
ElasticSearch Server
-i INDEX, --index=INDEX
Index name to use
@selenamarie
selenamarie / json_example.sql
Created May 24, 2013 23:17
Playing around with JSON and json_enhancements
You are now connected to database "postgres" as user "postgres".
postgres:5432# create table birds (bird_info json);
CREATE TABLE
Time: 162.227 ms
postgres:5432# insert into birds VALUES( '{"name": "scrubjay", "where": "my backyard", "when": "2013-05-24"}');
INSERT 0 1
Time: 0.616 ms
postgres:5432# select * from birds;
bird_info
--------------------------------------------------------------------
@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