This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UmaClasse::UmaClasse(int x, int y) | |
: _x(x), _y(y){ | |
// ... | |
} | |
// is the same of | |
UmaClasse::UmaClasse(int x, int y) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ${1:Model}sController < ApplicationController | |
before_filter :find_${1/./\l$0/}, :only => [:show, :edit, :update, :destroy] | |
# GET /${1/./\l$0/}s | |
# GET /${1/./\l$0/}s.xml | |
def index | |
@${1/./\l$0/}s = ${1:Model}.all | |
respond_to do |wants| | |
wants.html # index.html.erb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%ol | |
= f.input :name, :label_html => { :class => "label" }, :input_html => {:class => "text_field"}, :wrapper_html => {:class => "group"} | |
= f.input :description, :label_html => { :class => "label" }, :input_html => {:class => "text_field", :style => "width:100%"}, :wrapper_html => {:class => "group"} | |
= f.input :return_email, :label_html => { :class => "label" }, :input_html => {:class => "text_field"}, :wrapper_html => {:class => "group"} | |
= render "shared/form_buttons" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<string> | |
using namespace std; | |
class Book | |
{ | |
public: | |
Book(string a, double o) : author(a), other(o) {} | |
string author; | |
double other; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module CustomSearch | |
mattr_accessor :registered_classes | |
def self.search(qstring) | |
results = {} | |
self.registered_classes.each do |klass| | |
results[klass.name] = klass.on_index(qstring) | |
end | |
results | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Mail" | |
set theMessage to first item of every message in inbox | |
set theSubject to subject of theMessage | |
if theSubject contains "Failed" then | |
say "Chuck Norris is preparing a round house kick!" | |
else if theSubject contains "Normal" then | |
say "Chuck Norris can rest now." | |
end if | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using com.example.mixin; | |
using com.example.data; | |
namespace com.example.main | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
Mixed1 m1 = new Mixed1(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from plugin_manager import PluginManager | |
app = App() | |
app.plugin_manager = PluginManager() | |
app.plugin_manager.initialize_plugins() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a comment | |
# Simple variable assignment | |
$variable = "assignment" | |
# Create instances of any object that is reachable by the .NET framework | |
$object = New-Object "System.Double" | |
# you can call static methods from classes using [Type]::MethodName() | |
[string]::Format("This is an {0} of string {1}", "string", "interpolation") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)setupNavigationItems | |
{ | |
NSMutableArray* buttons = [NSMutableArray arrayWithCapacity:2]; | |
// Add items to the array | |
UIBarButtonItem* bi; | |
bi = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd | |
target:self | |
action:@selector(barButtonClicked:)]; | |
[buttons addObject:bi]; |
OlderNewer