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
PDFDocument = require 'pdfkit' | |
doc = new PDFDocument | |
# Embed a font, set the font size, and render some text | |
doc.font('fonts/PalatinoBold.ttf') | |
.fontSize(25) | |
.text('Some text with an embedded font!', 100, 100) | |
# Add another page | |
doc.addPage() |
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
var http = require('http'); | |
var exec = require('child_process').exec; | |
http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
exec('curl www.yahoo.com', function (error, stdout, stderr) { | |
//Parse stdout/stderr if/as needed |
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
app.put('/model', function(req,res){ | |
service.doWork(req.body,function(result){ | |
if(result){ | |
db.setStatus(result, function(){ | |
res.redirect('/ok'); | |
}); | |
} | |
}); | |
}); |
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
<script> | |
function defineVarInside(){ | |
x = 15; | |
} | |
defineVarInside(); | |
document.write(x); //15; | |
</script> | |
<script> |
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
/* | |
URL: | |
http://localhost/luca/site?movie=18&movie=22&movie=25 | |
*/ | |
var movies = request.query.movie; // ['18','22','25'] | |
var firstMovie = request.query.movie[0]; // '18'; |
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
/- | |
|_bin | |
|_Antlr3.Runtime.dll | |
|_Jint.dll | |
|_Luca.Core.dll | |
|_Luca.Jint.dll | |
|_Newtonsoft.Json.dll | |
|_controllers | |
|_main.js | |
|_views |
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.request.query.id | |
//or | |
this.request.query['id'] |
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
public class PrototypeArrays : IExtension | |
{ | |
private JsConstructor Target { get; set; } | |
public void ExtendTarget(JsConstructor target) | |
{ | |
Target = target; | |
Target.Prototype.DefineOwnProperty("collect", Target.Global.FunctionClass.New<JsObject>(CollectImpl), PropertyAttributes.DontEnum); | |
Target.Prototype.DefineOwnProperty("clear", Target.Global.FunctionClass.New<JsArray>(ClearImpl), PropertyAttributes.DontEnum); | |
Target.Prototype.DefineOwnProperty("clone", Target.Global.FunctionClass.New<JsArray>(CloneImpl), PropertyAttributes.DontEnum); | |
Target.Prototype.DefineOwnProperty("toArray", Target.Global.FunctionClass.New<JsArray>(CloneImpl), PropertyAttributes.DontEnum); |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Model" namespace="Model"> | |
<class name="Scene" table="Scene"> | |
<composite-id> | |
<key-property column ="Code" name="Code"/> | |
<key-property column ="Scene" name="SceneID"/> | |
</composite-id> | |
<set name="Stars" lazy="false" table="Scene2Star"> | |
<key> | |
<column name="Movie"/> |
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 doesn't work | |
doesnt_work = {|v=0| puts v} | |
# while this does | |
it_works = -> (v=0) { puts v} |