Skip to content

Instantly share code, notes, and snippets.

@ryandotsmith
ryandotsmith / a-backbone-js-demo-app-sinatra-backend.md
Created January 22, 2012 01:42
Backbone demo app with sinatra backend

A Backbone.js demo app (Sinatra Backend)

Oct 16 2010

Updates

  • 04/10/2011 - Updated application.js and application.rb thanks to @rebo's comments

In this article, I will walk through some simple steps to get a [demo app][2] up and running with [Backbone.js][3] and [Sinatra][4] on [Heroku][5].

@half-ogre
half-ogre / NuGet.targets.xml
Created February 22, 2012 04:22
A replacement for the NuGet.targets file that requires nuget.exe be on the path, so you don't have to commit it.
<?xml version="1.0" encoding="utf-8"?>
<!-- #### NOTE #### -->
<!-- To build with Mono's xbuild on bash, you must execute [`sudo install-nuget.sh`](https://gist.github.com/2595337) first. -->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
<!-- Windows specific commands -->
@mhinze
mhinze / exposeiis.ps1
Created February 22, 2012 14:39
Sample solutionscript to expose IIS
function global:ExposeIIS()
{
$config = [xml] ( get-content $env:IIS_USER_HOME/config/applicationhost.config )
# Add in new bindings for computer name
foreach($site in $config.configuration."system.applicationHost".sites.site)
{
foreach($bindings in $site.bindings)
{
# no need to add another binding for machine name if its exists
@dgrunwald
dgrunwald / async.cs
Created March 2, 2012 20:33
Async/Await support for .NET 4.0
// Copyright (c) 2012 Daniel Grunwald
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
@zilkey
zilkey / ember-precompile.js
Created March 10, 2012 22:30 — forked from garth/Jakefile.js
Precompile .handlebars templates with node js
var fs = require('fs');
var vm = require('vm');
var emberjs = fs.readFileSync('public/javascripts/vendor/ember-0.9.5.min.js', 'utf8');
var templatesDir = 'templates';
var destinationDir = 'public/javascripts/templates';
function compileHandlebarsTemplate(templatesDir, fileName) {
var file = templatesDir + '/' + fileName;
@bradwilson
bradwilson / InlineTask.targets.xml
Created March 11, 2012 00:41
Inline MSBuild task to download NuGet.exe
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<OutputFilename ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
<Using Namespace="System" />
<Using Namespace="System.IO" />
@thecodejunkie
thecodejunkie / CustomErrorHandler.cs
Created March 26, 2012 16:38
Rendering a razor view from a custom error handler
public class CustomErrorHandler : IErrorHandler
{
private readonly IViewFactory factory;
private readonly IViewLocationCache cache;
public CustomErrorHandler(IViewFactory factory, IViewLocationCache cache)
{
this.factory = factory;
this.cache = cache;
}
@woloski
woloski / BasicIdea.cs
Created April 25, 2012 15:51
Fire and forget with TPL and retry on ASP.NET
Task.Factory.StartNew((state) =>
{
try
{
// use http://nuget.org/packages/TransientFaultHandling.Core
// the defaultfixed strategy retries 10 times every 1 second
RetryPolicy.DefaultFixed.ExecuteAction(() =>
{
// do something that might throw an exception like calling an http endpoint
});
@half-ogre
half-ogre / install-nuget.sh
Created May 4, 2012 15:04
A bash script to install nuget.exe and make it available in bash with a proxy script
#!/bin/sh
current_dir=`pwd`
temp_dir=`mktemp -d nuget-curl`
cd $temp_dir
curl -O http://anglicangeek.com/nuget.exe
rm -rf /usr/local/libexec/nuget.exe
mv ./nuget.exe /usr/local/libexec/
cd $current_dir
rm -rf $temp_dir
rm -rf /usr/bin/local/nuget
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 13, 2024 05:29
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname