Skip to content

Instantly share code, notes, and snippets.

@felipeg48
felipeg48 / java-basic-001
Created September 23, 2012 15:47
Java - Basic class
public class Sample{
public static void main(String[] args){
System.out.println("Hello World");
}
}
@felipeg48
felipeg48 / gist:4052316
Created November 10, 2012 20:05 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
# Send batch parameters for monitoring.
#
# NOTE: This requires the zabbix group to have non-password sudo
# access on all instances where this runs. rabbitmqctl requires
# elevated perms to execute.
#
#
# Meta params.
#
brew update
brew versions FORMULA
cd `brew --prefix`
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions"
brew install FORMULA
brew switch FORMULA VERSION
git checkout -- Library/Formula/FORMULA.rb # reset formula
## Example: Using Subversion 1.6.17
#
/*
* Copyright 2002-2010 the original author or authors.
*
* 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
#!/usr/bin/ruby
#
# This script fixes /usr/local only.
#
# Run: ruby -e "$(curl -fsSL https://gist.github.com/raw/768518/fix_homebrew.rb)"
#
# 6th January 2010:
# Modified the script to just fix, rather than install. - rpavlik
#
# 30th March 2010:
@Grab("org.grails:gorm-mongodb-spring-boot:1.0.0.M1")
import grails.persistence.*
import grails.mongodb.geo.*
import org.bson.types.ObjectId
import com.mongodb.BasicDBObject
import com.mongodb.Mongo
import org.springframework.http.*
import org.springframework.beans.factory.annotation.Autowired
import static org.springframework.web.bind.annotation.RequestMethod.*
// No commas
def a = 'tim'
def nocom = match( a ) {
when 'dave' 'Hi Dave'
when 'tim' 'Hi Tim'
otherwise 'none of the above'
}
assert nocom == 'Hi Tim'
// Commas
using System;
using MonoTouch.UIKit;
using MonoTouch.SceneKit;
using MonoTouch.Foundation;
namespace HelloSceneKit
{
public class HelloSceneKitController : UIViewController
{
SCNView sceneView;
/* jQuery Tinier Pub/Sub - v0.9 - 2013-02-11
* original by http://benalman.com/ 10/27/2011
* Original Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
// "topic" holder
var o = $({}); // use $('<b>') with Zepto, as it doesn't like {} ?
// attach each alias method