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
// Newbie programmer | |
int factorial_newbie(int n) { | |
if (n == 0) { | |
return 1 | |
} else { | |
return n * factorial_newbie(n - 1) | |
} | |
} | |
println factorial_newbie(6) |
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 sys = require('./rx_sys'); | |
var http = require('./rx_http'); | |
var fs = require('./rx_fs'); | |
var url = require('url'); | |
var path = require('./rx_path'); | |
var serverData = http.createServer(); | |
var requests = serverData.Select(function(details) { | |
details.url = url.parse(details.request.url); |
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 System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Amazon.CloudFront; | |
using Amazon.CloudFront.Model; | |
using System.Collections.Specialized; | |
using System.Configuration; | |
// Require AWS SDK for .NET http://aws.amazon.com/sdkfornet/ |
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
ctrl-z | |
bg | |
touch /tmp/stdout | |
touch /tmp/stderr | |
gdb -p $! | |
# In GDB | |
p dup2(open("/tmp/stdout", 1), 1) | |
p dup2(open("/tmp/stderr", 1), 2) |
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
// WebMatrix.Data's Query method returns an IEnumerable<dynamic> | |
// While this is great for simple scenarios, if you want to add behaviour to your DB objects | |
// then it can be a pain. Here's a simple wrapper that adds a strongly-typed Query method | |
// This is a simple implementation and could be improved. | |
// Represents a table in the database | |
public class User { | |
public int Id { get; set; } | |
public string Name { get; set; } | |
} |
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
/* | |
As of version 1.1.2, Propane will load and execute the contents of | |
~Library/Application Support/Propane/unsupported/caveatPatchor.js | |
immediately following the execution of its own enhancer.js file. | |
You can use this mechanism to add your own customizations to Campfire | |
in Propane. | |
Below you'll find two customization examples. |
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
$ git clone github:lenary/guides.git | |
Cloning into guides... | |
remote: Counting objects: 255, done. | |
remote: Compressing objects: 100% (216/216), done. | |
remote: Total 255 (delta 111), reused 163 (delta 35) | |
Receiving objects: 100% (255/255), 1.49 MiB | 564 KiB/s, done. | |
Resolving deltas: 100% (111/111), done. | |
$ cd guides | |
$ git remote -v |
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
return EventStore.Wireup.Init() | |
.UsingSqlPersistence("EventStore") | |
.InitializeDatabaseSchema() | |
.UsingCustomSerializer(new JsonSerializer()) | |
.Compress() | |
.EncryptWith(EncryptionKey) | |
.UsingAsynchronousDispatcher() | |
.PublishTo(new DelegateMessagePublisher(DispatchCommit)) | |
.HandleExceptionsWith(DispatchErrorHandler) | |
.Build(); |
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 BrowserFixture | |
{ | |
private readonly Browser browser; | |
public BrowserFixture() | |
{ | |
var bootstrapper = | |
new FakeDefaultNancyBootstrapper(); | |
this.browser = new Browser(bootstrapper); |
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 System; | |
using System.Collections.Generic; | |
using System.Web; | |
using System.Linq; | |
using SisoDb; | |
/// <summary> | |
/// Requires the NuGet packages Nancy.Hosting.Aspnet and SisoDb | |
/// and a local Database in .\Sqlexpress called sisodemo | |
/// </summary> |
OlderNewer