Skip to content

Instantly share code, notes, and snippets.

View unicolet's full-sized avatar

Umberto Nicoletti unicolet

View GitHub Profile
@unicolet
unicolet / YUIMenubarTagLib.groovy
Created November 11, 2011 14:36
grailsUI_menubar
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@unicolet
unicolet / rsync-server-gist.nsi
Created January 12, 2012 22:58
Nullsoft script to create an installer for a rsync Windows Service package based on cygwin
;NSIS Modern User Interface
;Rsync Windows Service Script
;Written by Umberto Nicoletti http://unicolet.blogspot.com/
!define SCRIPT_VERSION "1.0"
;--------------------------------
;Include Modern UI
!include "MUI2.nsh"
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
@unicolet
unicolet / sproutcore_dev_from_scratch_ubuntu.sh
Last active September 30, 2015 20:48
Sproutcore official and development from scratch on barebone Ubuntu Linux
#
# Use these commands to install sproutcore official (and development version)
# on Ubuntu linux
#
# Tested on Lucid Lynx provisioned by vagrant (http://vagrantup.com/)
#
sudo apt-get install curl
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
source /home/vagrant/.rvm/scripts/rvm
source /home/vagrant/.profile
@unicolet
unicolet / todos sc.outlet patch
Created February 26, 2012 18:09
add sc.outlet usage to todos tutorial as per ericocean's suggestion. Apply with patch -p1 < outlet.patch
diff --git a/apps/todos/main.js b/apps/todos/main.js
index 7fbd18a..06ccd2e 100644
--- a/apps/todos/main.js
+++ b/apps/todos/main.js
@@ -28,7 +28,8 @@ Todos.main = function main() {
Todos.store.find(SC.Query.local(Todos.Todo, 'isCompleted = true')));
// Focus the new todos item
- Todos.mainPage.getPath('mainPane.newTodoField.field').becomeFirstResponder();
+ Todos.mainPage.get('field').becomeFirstResponder();
@unicolet
unicolet / jsts_with_nodejs.js
Created May 28, 2012 10:52
using jsts (Javascript Topology Suite) with nodejs
#!/usr/bin/nodejs
# run from jsts directory, the script expects lib to be a subdir of current dir
var i = require('./lib/javascript.util.js');
var j = require('./lib/jsts.js');
var geometryFactory = new jsts.geom.GeometryFactory();
var coordinate = new jsts.geom.Coordinate(1,2);
var point = geometryFactory.createPoint(coordinate);
@unicolet
unicolet / osm_bright_bg
Created June 6, 2012 07:34
TileDrawer: change bright style background color
--- style.xml.orig 2012-05-31 15:39:50.080704580 +0200
+++ style.xml 2012-05-31 15:40:36.856701370 +0200
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over" bgcolor="rgb(140,182,211)">
+<Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over" bgcolor="rgb(241,238,232)">
<Style name="line pattern style 110">
<Rule name="rule 589">
<Filter>(not (([tunnel]='true')) and not (([tunnel]='yes')))</Filter>
@unicolet
unicolet / reader.py
Created June 27, 2012 10:35
Nagios cfg from Google Docs
import csv
from jinja2 import Template,FileSystemLoader,Environment
loader = FileSystemLoader('templates')
env = Environment(loader=FileSystemLoader('templates'))
tmp=[]
hostgroups=set()
hosts = csv.reader(open('hosts.csv'), delimiter=',', quotechar='"')
for h in hosts:
@unicolet
unicolet / refresh list view.js
Created July 6, 2012 12:25
Refresh SC.ListVIew (and scroll down)
/*
NOTE: replace YourListView/YourController with the actual names of the
controller/listview in your app.
*/
YourController.content.add(yournewobject);
this.invokeLater(function(){
YourListView.computeLayout();
YourListView.scrollDownPage();
@unicolet
unicolet / links.pl
Created July 15, 2012 16:44
Find latest Tomcat 7 version