Skip to content

Instantly share code, notes, and snippets.

{
"metadata": {
"Title": {
"__type": "Nancy.DynamicDictionaryValue, Nancy",
"hasValue": true,
"value": " Welcome to Simple Blog"
},
"Author": {
"__type": "Nancy.DynamicDictionaryValue, Nancy",
"hasValue": true,
@prabirshrestha
prabirshrestha / Bootstrapper.cs
Created December 5, 2012 17:32
Nancy ServiceStack camel casing
public class Bootstrapper : DefaultNancyBootstrapper
{
protected override void ApplicationStartup(TinyIoC.TinyIoCContainer container, IPipelines pipelines)
{
base.ApplicationStartup(container, pipelines);
ServiceStack.Text.JsConfig.EmitCamelCaseNames = true;
}
protected override NancyInternalConfiguration InternalConfiguration
{
@prabirshrestha
prabirshrestha / .gitignore
Created December 12, 2012 23:51
android .gitignore
.DS_Store
Thumbs.db
out/
*.class
local.properties
workspace.xml
tasks.xml
@prabirshrestha
prabirshrestha / preferences
Created January 24, 2013 02:27
vi ~/Library/Preferences/VMware\ Fusion/preferences
.encoding = "UTF-8"
pref.keyboardAndMouse.defaultProfileKey = "527506b7-3a0a-d792-1153-725ac551"
pref.keyboardAndMouse.maxProfiles = "3"
pref.keyboardAndMouse.profile0.profileKey = "52257a32-b4fe-dd0b-327d-ff7d8d5c"
pref.keyboardAndMouse.profile0.profileName = "Windows 8 Profile"
pref.keyboardAndMouse.profile0.profileType = "windows8"
pref.keyboardAndMouse.profile0.enableOSShortcuts = "TRUE"
pref.keyboardAndMouse.profile0.enableKeyMappings = "TRUE"
pref.keyboardAndMouse.profile0.languageSpecificKeyMappingsEnabled = "FALSE"
pref.keyboardAndMouse.profile0.selectedLanguage = ""
@prabirshrestha
prabirshrestha / bootstrapper.cs
Last active December 12, 2015 00:29
squishit + nancyfx + sprockets
public class Bootstrapper :DefaultNancyBootstrapper
{
protected override void ApplicationStartup(Nancy.TinyIoc.TinyIoCContainer container, Nancy.Bootstrapper.IPipelines pipelines)
{
base.ApplicationStartup(container, pipelines);
BundleScripts(container.Resolve<IRootPathProvider>().GetRootPath());
}
protected override void ConfigureConventions(NancyConventions nancyConventions)
{
@prabirshrestha
prabirshrestha / .gitignore
Last active December 12, 2015 08:19
android maven
*/target
target
tmp
*~
bin
*/test-output
temp-testng-customsuite.xml
**pom.xml.releaseBackup
release.properties
gen
#!/usr/bin/perl -w
# Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
@prabirshrestha
prabirshrestha / node-callback-to-rx.js
Created February 15, 2013 13:30
some function that makes it easier to convert node style callback to observable
var fs = require('fs'),
Rx = require('rx').Rx,
rxc = Rx......; // some function that makes it easier to convert node style callback to observable
rsc(fs, 'readFile', __filename)
.select(function(text) {
return text.toUpperCase();
})
.subscribeNext(function(text){
var json;
try {
json = JSON.parse(body);
} catch (ex) {
// sometimes FB is has API errors that return HTML and a message
// of "Sorry, something went wrong". These are infrequent and unpredictable but
// let's not let them blow up our application.
json = { error: {
code: 'JSONPARSE',
@property (nonatomic, readwrite) BOOL idle;
// start button is enabled only if idle
self.startButton.rac_command = [RACCommand commandWithCanExecuteSignal:RACAbleWithStart(self.idle)];
// enable stop button only when we are not idle
self.stopButton.rac_command = [RACCommand commandWithCanExecuteSignal:([RACAbleWithStart(self.idle) map:^id(id value) {
return [NSNumber numberWithBool:![value boolValue]];
}])];