First, you need to install PowerShell version 2.
Log in to the server machine, start PowerShell as an administrator and execute:
Enable-PSRemoting
scala> :javap Greeter -c | |
Compiled from "<console>" | |
public class Greeter extends java.lang.Object implements scala.ScalaObject{ | |
public static {}; | |
Code: | |
0: iconst_0 | |
1: anewarray #8; //class java/lang/Class | |
4: putstatic #14; //Field reflParams$Cache1:[Ljava/lang/Class; | |
7: new #16; //class java/lang/ref/SoftReference | |
10: dup |
class User < ActiveRecord::Base | |
has_file :avatar, AvatarUploader | |
validates_file_extension_of :avatar, :allowed => ["jpg", "png"] | |
end |
//Invoke with: scala -cp /opt/processing-1.5.1/lib/core.jar processing.scala | |
import processing.core._ | |
import java.io._ | |
import java.awt.image._ | |
import javax.imageio._ | |
class Image extends PApplet { | |
private[this] val width = 200 | |
private[this] val height = 200 |
object AuthMailer extends Mailer { | |
def sendWelcomeEmail(account: Account)(implicit settings: MailerSettings) { | |
val subject = "[Progstr Filer] Welcome to Progstr Filer!" | |
send( | |
From("[email protected]", "Mysite Support"), | |
To(account.email -> account.name), | |
Subject(subject), | |
HtmlTemplate("welcome-html", | |
'name -> "Hristo", 'subject -> subject, 'account -> account), | |
TextTemplate("welcome-text", |
import inspect | |
from functools import wraps | |
def set_attributes(constructor): | |
@wraps(constructor) | |
def wrapped(self, *args, **kwargs): | |
names = inspect.getargspec(constructor).args | |
for (key, value) in dict(zip(names[1:], args)).items(): | |
setattr(self, key, value) | |
for (key, value) in kwargs.items(): |
For maximum Python 2.x -> Python 3 compatibility:
from future import absolute_import, division, print_function, unicode_literals
ninja_required_version = 1.6 | |
tsflags = --module commonjs --noEmitOnError --noImplicitAny --emitDecoratorMetadata --experimentalDecorators --target es5 | |
rule tsc | |
command = ./node_modules/.bin/tsc $tsflags "$in" && node build/getrefs.js "$in" "$out" "$in.dep" | |
description = TypeScript compile: $in | |
depfile = "$in.dep" | |
deps = gcc | |
rule dts | |
command = touch "$out" | |
description = TypeScript declarations: $in |