For those coming from a Windows devleopment background...
- The stack is more fragmented than .NET land. Each piece of the stack has it's own versions
- Portions are interchangable.
import urllib.request,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404e330c659d4bb41d3bdf022e94cab3cd0'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), 'wb' ).write(by) if dh == h else None; print('Error validating download (got %s instead of %s), please try manual install' % (dh, h) if dh != h else 'Please restart Sublime Text to finish installation') |
<#@ template debug="True" hostspecific="True" language="C#" #> | |
<#@ output extension=".cs" #> | |
<#@ Assembly Name="System" #> | |
<#@ Assembly Name="System.Configuration" #> | |
<#@ assembly name="System.Core" #> | |
<#@ Assembly Name="System.Collections" #> | |
<#@ Assembly Name="System.Data" #> | |
<#@ Assembly Name="System.Linq" #> | |
<#@ Assembly Name="System.Xml" #> | |
<#@ Assembly Name="System.Xml.Linq" #> |
<#@ template debug="True" hostspecific="True" language="C#" #> | |
<#@ output extension=".cs" #> | |
<#@ Assembly Name="System.Configuration" #> | |
<#@ assembly name="System.Core" #> | |
<#@ Assembly Name="System.Collections" #> | |
<#@ Assembly Name="System.Data" #> | |
<#@ Assembly Name="System.Linq" #> | |
<#@ Assembly Name="System.Xml" #> | |
<#@ Assembly Name="System.Xml.Linq" #> | |
<#@ assembly name="Microsoft.SqlServer.ConnectionInfo" #> |
using System; | |
namespace GenericConstructorTest | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// This doesn't compile | |
var myClass1 = new MyClass(5, 6); |
public string GetProductCategory() | |
{ | |
var category = GetFirstCategory(CurrentDocument); | |
if (category != null) | |
{ | |
var qsvalue = category.CategoryID; | |
return "?subject=" + qsvalue; | |
} |
public void AddItemToShoppingCart(int skuId, int quantity) | |
{ | |
var skuInfo = SKUInfoProvider.GetSKUInfo(skuId); | |
// Create params | |
var cartItemParams = new ShoppingCartItemParameters(skuId, quantity); | |
// Ensure minimum allowed number of items is met | |
if (skuInfo.SKUMinItemsInOrder > quantity) | |
{ |
#!/usr/bin/env python | |
# saved to ~/bin/batcharge.py and from | |
# http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/#my-right-prompt-battery-capacity | |
#!/usr/bin/env python | |
# coding=UTF-8 | |
import math, subprocess | |
p = subprocess.Popen(["ioreg", "-rc", "AppleSmartBattery"], stdout=subprocess.PIPE) | |
output = p.communicate()[0] |
<#@ template debug="True" hostspecific="True" language="C#" #> | |
<#@ output extension=".cs" #> | |
<#@ Assembly Name="System.Configuration" #> | |
<#@ assembly name="System.Core" #> | |
<#@ Assembly Name="System.Collections" #> | |
<#@ Assembly Name="System.Data" #> | |
<#@ Assembly Name="System.Linq" #> | |
<#@ Assembly Name="System.Xml" #> | |
<#@ Assembly Name="System.Xml.Linq" #> | |
<#@ assembly name="Microsoft.SqlServer.ConnectionInfo" #> |