Skip to content

Instantly share code, notes, and snippets.

@terrancesnyder
terrancesnyder / setenv.sh
Created May 23, 2011 00:07
./setenv.sh - example setenv.sh with defaults set for minimal time spent in garbage collection
#! /bin/sh
# ==================================================================
# ______ __ _____
# /_ __/___ ____ ___ _________ _/ /_ /__ /
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / /
# / / / /_/ / / / / / / /__/ /_/ / /_ / /
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/
# Multi-instance Apache Tomcat installation with a focus
# on best-practices as defined by Apache, SpringSource, and MuleSoft
@jpoehls
jpoehls / gist:2030795
Created March 13, 2012 19:02
Using CTRL+W to close tabs in Visual Studio

In Tools | Options | Keyboard...

  1. Add CTRL+W as a Global shortcut for Window.CloseDocumentWindow
  2. Remove the CTRL+W shortcut for Edit.SelectCurrentWord

The caveat to this is if you are used to using CTRL+W to select the current word. If you do, find another shortcut that works for that.

@azizmb
azizmb / carmen_country_input.rb
Created May 18, 2012 19:24
Carmen Country input field for SimpleForm
class CarmenCountryInput < SimpleForm::Inputs::PriorityInput
def input
@builder.send(:"country_select", attribute_name, input_options, input_html_options)
end
end
@peaeater
peaeater / powershell filename replace
Created August 22, 2013 17:00
Replace a portion of a filename in a list of filenames with regex.
ls * -name | ren -newname {$_ -replace '^(.*)-replaceme-(.*)$', '$1-newvalue-$2'}
@chaoaretasty
chaoaretasty / WebAPI HttpContext for Autofac
Created October 14, 2013 16:53
Hackily enable HttpContext in WebAPI and Autofac
/*
While generally using HttpContext, and all of the related properties such as
Cookies and Session, in WebAPI is not the right way sometimes it needs to be
done, especially when migrating existing code before doing a full rewrite but
could happen in any legacy MVC project you want to bring WebAPI into.
When using Autofac there is the AutofacWebTypesModule which allows you to resolve
these dependencies, all of which come from resolving HttpContextBase.
WebAPI doesn't provide HttpContext directly but if hosted in IIS rather than
@ryanlewis
ryanlewis / umbraco-jul-fix.ps1
Created July 22, 2014 10:54
Powershell script to resolve the Umbraco security advisory released 21 July 2014
Param(
[Parameter(Mandatory=$true)] $path
)
$proxyHtm = @"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Repo proxy</title>
</head>
@kcargile
kcargile / ConfigurableFilterProvider.cs
Created August 8, 2014 13:32
Inject Castle Windsor Dependencies into ASP.NET Web API Filter C#
using System.Collections.Generic;
using System.Diagnostics;
using System.Web.Http;
using System.Web.Http.Controllers;
using System.Web.Http.Filters;
using Castle.Windsor;
using Algorythmic.Web.API.Filters;
namespace Algorythmic.Web.API.Windsor.Filters
{
@amirouche
amirouche / getting.started.with.react.md
Last active August 29, 2015 14:12
Getting started with react
  • Install npm and nodejs (on debian I had to link /usr/bin/nodejs to /usr/bin/node
  • At the root of your project create package.js file with the an empty json object:
$ echo "{}" > package.js 

In the same directory, install all the project dependencies with the following command:

@ChuckJHardy
ChuckJHardy / reactjs-example.js
Last active September 15, 2016 09:23
ReactJS Example Structure
React.createClass({
displayName: 'Name',
propTypes: {},
mixins: [],
getInitialState: function() {
return {};
},
getDefaultProps: function() {
@CalebEverett
CalebEverett / gist:712fb3948d2695a95957
Last active January 26, 2017 21:01
Help with material-ui leftNav,react-router and redux

I am having trouble getting this to work. I'm trying to get the material ui leftNav to work with react router and redux with nav going through the store and router. This was close, but didn't get all the way to the menu item.

TypeError: Cannot read property 'isActive' of undefined

I was also referring to these examples: https://github.com/callemall/material-ui/blob/master/docs/src/app/components/app-left-nav.jsx

http://codetheory.in/react-integrating-routing-to-material-uis-left-nav-or-other-components/