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
| private Dictionary<string, string> PathForRegex(string path) | |
| { | |
| var dic = new Dictionary<string, Regex> { | |
| {"foo", new Regex("foo/(?<directory_id>\\d+)/bar/(?<coast>\\d+)/hei", RegexOptions.ExplicitCapture)}, | |
| {"hei", new Regex("foo/(?<name>\\w+)/jow", RegexOptions.ExplicitCapture)} | |
| }; | |
| var Params = | |
| ( |
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.Data.SqlClient; | |
| using System.Text.RegularExpressions; | |
| using Dapper; | |
| namespace ConsoleApplication2 | |
| { |
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
| public interface IRenderable | |
| { | |
| string TransformText(); | |
| string Render<T>(object parameters); | |
| void Initialize(); | |
| } | |
| public partial class Layout : IRenderable | |
| { | |
| public IRenderable Content { get; set; } |
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
| #r "System.Xml.dll" | |
| #r "System.Runtime.Serialization.dll" | |
| open Microsoft.FSharp.Reflection | |
| open System.IO | |
| open System.Reflection | |
| open System.Runtime.Serialization | |
| open System.Runtime.Serialization.Formatters.Binary | |
| open System.Runtime.Serialization.Json | |
| open System.Text |
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
| // Demo: | |
| // | |
| // let files = sh "ls -a /Users/david" |> lines | |
| // let install = sh "cp -r %s /Applications" | |
| // install "/Volumes/Awareness/Awareness.app" | |
| // | |
| module Campari.Shell | |
| open System |
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
| jQuery.download = function (url, data, callback) { | |
| if (jQuery.browser.msie) { | |
| download(url, data, callback); | |
| } else { | |
| setTimeout(function() { | |
| download(url, data, callback); | |
| }, 100); | |
| } | |
| }; |
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
| (defun ruby-align-hash (begin end) | |
| "Aligns ruby symbol-keyed hashes" | |
| (interactive "r") | |
| (align-regexp begin end "\\(\\s-*\\)[a-z_]+:" 1 1)) | |
| (define-key ruby-mode-map "\C-xrh" 'ruby-align-hash) |
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
| ;; initialize packages | |
| (require 'package) | |
| (add-to-list 'package-archives | |
| '("marmalade" . "http://marmalade-repo.org/packages/")) | |
| (add-to-list 'package-archives | |
| '("melpa" . "http://melpa.milkbox.net/packages/") t) | |
| (package-initialize) |
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
| #!/usr/bin/env ruby | |
| # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. | |
| APP_PATH = File.expand_path('../../config/application', __FILE__) | |
| require File.expand_path('../../config/boot', __FILE__) | |
| # In order to allow the requirement of gems that aren't in Gemfile | |
| # remember that the gems must be installed in global gemset |
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
| /* ============================================================= | |
| * bootstrap-typeahead.js v2.2.2 | |
| * http://twitter.github.com/bootstrap/javascript.html#typeahead | |
| * ============================================================= | |
| * Copyright 2012 Twitter, Inc. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * |