This file contains 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
# checks settings and changes the theme depending on the file location | |
# default_folder_theme: string of the theme to use normally | |
# folder_themes: object with key/value of find/theme | |
# ex: { | |
# "trunk": "Packages/User/trunk.tmTheme", | |
# "alt/folder": "Packages/User/darkUi.tmTheme" | |
# } | |
import sublime | |
import sublime_plugin |
This file contains 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
# Sublime Plugin that will take the selected text(s) | |
# and replace it with a variable name you provide. The name and | |
# values are then prepended to the top of the file | |
import sublime, sublime_plugin, re | |
# handles asking for what to replace the selection with | |
class PromoteCssCommand( sublime_plugin.WindowCommand ): | |
def run( self ): |
This file contains 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 $ = module.exports | |
, $fs = require('fs') | |
, $path = require('path') | |
, $http = require('http') | |
, $query = require('querystring') | |
, $run = require('child_process').spawn | |
// optional jade templates | |
, $jade |
This file contains 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
module.exports = { | |
//resolves the root of the site | |
map_path: function(path) { | |
return path.replace(/^~/, global.process.env.PWD); | |
}, | |
//resolves the path and performs a require | |
require: function(path) { |
This file contains 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
// | |
// wires up an object of selectors | |
// | |
// var ui = { | |
// menu: "#main-menu", | |
// list: "#list .item", | |
// options: { | |
// yes: "#option-yes", | |
// no: "#option-no" | |
// } |
This file contains 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 script = document.createElement("script"); | |
script.src = "http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"; | |
document.body.appendChild(script); | |
var start_typing = function(jquery, timeout) { | |
var input = jquery(".txtInput"); | |
var do_next_phrase = function() { | |
This file contains 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 an anonymous type directly (even being passed in as a Dynamic) | |
//will result in an exception message. Using this converts the Anonymous | |
//type to a dynamic that can be used as expected | |
//this doesn't include any validation of properties but it can be done | |
@helper something_that_renders_lists(params dynamic[] links) { | |
links = Json.Decode(Json.Encode(links)); | |
<ul> | |
@foreach(var link in links) { |
This file contains 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 class HomeController : Controller { | |
public ActionResult Index() { | |
var view = new ViewFor.Index { Name = "Hugo" }; | |
return this.View(view); | |
} | |
public static class ViewFor { | |
public class Index { |
This file contains 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
// Call CaseInsensitiveViewEngine.Register(...) from Global.asax | |
using System; | |
using System.Web; | |
using System.Web.Mvc; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Web.Routing; | |
This file contains 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
'requests a name and attaches to that process | |
Public Sub AttachToNamedProcess() | |
Dim process As String = InputBox("What process name", "Process Name", "w3wp.exe") | |
'make sure something was provided | |
If process Is Nothing Then process = "" | |
process = process.Trim() | |
If String.IsNullOrEmpty(process) Then Return | |
_AttachToProcess(process, False) | |
End Sub |
NewerOlder