This file contains hidden or 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 System.Reflection; | |
namespace AssemblyDiscoveryConsole | |
{ | |
// The attribute class you are looking for within external assemblies | |
public class SomeAttribute : Attribute |
This file contains hidden or 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
// Add a reference to the Microsoft.Web.Administration assembly. | |
// Note: | |
// 1) Make sure you have IIS7 Features turned on for this library to be available (Windows features). | |
// 2) Ensure that you have a reference to System.ServiceModel. | |
// 3) Ensure that your target framework is .Net Framework 4. | |
// Location: | |
// C:\Windows\System32\inetsrv\Microsoft.Web.Administration.dll | |
// Resources: | |
// http://blogs.msdn.com/b/carlosag/archive/2006/04/17/microsoftwebadministration.aspx |
This file contains hidden or 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
// Xaml window example code | |
<Window.InputBindings> | |
<KeyBinding Gesture="Ctrl+Alt+Add" Command="{Binding IncrementCommand}" /> | |
<KeyBinding Gesture="Ctrl+Alt+Subtract" Command="{Binding DecrementCommand}" /> | |
</Window.InputBindings> | |
// use globally with NHotkey (https://github.com/thomaslevesque/NHotkey) | |
<Window.InputBindings> | |
<KeyBinding Gesture="Ctrl+Alt+Add" Command="{Binding IncrementCommand}" | |
HotkeyManager.RegisterGlobalHotkey="True" /> |
This file contains hidden or 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
SNIPPETS: GET APPSETTINGS FROM XXX.CONFIG IN A GENERIC WAY | |
This snippet can be used in all web projects where there is a need to get settings from the AppSettings section in web.config. | |
INITIAL SNIPPET: | |
? | |
public static T GetAppSetting<T>(string key, T defaultValue) | |
{ | |
if (!string.IsNullOrEmpty(key)) | |
{ | |
string value = ConfigurationManager.AppSettings[key]; |
This file contains hidden or 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 ErrorMapper = require('./ErrorMapper'); | |
var formConverter = require('./formConverter'); | |
var JaySchema = require('jayschema'); | |
var util = require('util'); | |
var js = new JaySchema(); | |
function SchemaValidator (schema) { | |
return function SchemaValidator (req, res, next) { | |
js.validate(req.body, schema, function (errors) { //REVIEW | |
if (errors) { |
This file contains hidden or 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
// First export vars | |
echo export NODE_ENV=production >> ~/.bash_profile | |
$ source ~/.bash_profile | |
// then start the serverin some mode (production default) | |
NODE_ENV=testing node app.js | |
Load the environment config in ./config/index.js |
This file contains hidden or 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
// | |
// Deriving from TextBox | |
// | |
public class ClickSelectTextBox : TextBox | |
{ | |
public ClickSelectTextBox() | |
{ | |
AddHandler(PreviewMouseLeftButtonDownEvent, | |
new MouseButtonEventHandler(SelectivelyIgnoreMouseButton), true); | |
AddHandler(GotKeyboardFocusEvent, |
This file contains hidden or 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
<Style x:Key="ReadOnlyTextBox" TargetType="TextBox"> | |
<Setter Property="IsReadOnly" Value="True" /> | |
<Setter Property="Padding" Value="5"/> | |
<Setter Property="Margin" Value="0"/> | |
<Setter Property="Background" Value="Transparent"/> | |
<Setter Property="BorderBrush" Value="Transparent"/> | |
<Setter Property="BorderThickness" Value="0"/> | |
<Setter Property="IsTabStop" Value="False"/> | |
<Setter Property="HorizontalScrollBarVisibility" Value="Disabled"/> | |
<Setter Property="VerticalScrollBarVisibility" Value="Disabled"/> |
This file contains hidden or 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
Steps: | |
0. Checkout your git repo from the server (I use /var/www/carbonite) | |
1. Upload both of these files to the same directory on your server | |
2. chmod +x restart_node.sh | |
3. nohup node github_post_commit.js 2>&1 >> github_post_commit.log & | |
4. In the github admin for your repo, set a post commit hook to the url http://<your host>:8080/ | |
5. Make a commit to your repo | |
6. Point a browser at http://<your host>:8080/ and you should see the commit |
This file contains hidden or 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
http://www.cribeo.com/estilo_de_vida/6857/respuestas-al-salir-de-fiesta-a-los-18-vs-respuestas-salir-de-fiesta-a-los-25 |