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
sudo npm install -g node-inspector | |
sudo node-debug app.js --debug-brk |
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
static IEnumerable<string> FetchStockQuotes(string[] symbols) | |
{ | |
var quotes = new List<string>(); | |
string url = string.Format("http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20({0})&env=store://datatables.org/alltableswithkeys", | |
String.Join("%2C", symbols.Select(s => "%22" + s + "%22"))); | |
var wc = new WebClient {Proxy = WebRequest.DefaultWebProxy}; | |
var ms = new MemoryStream(wc.DownloadData(url)); | |
var reader = new XmlTextReader(ms); | |
XDocument doc = XDocument.Load(reader); |
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
dynamic expando = new ExpandoObject(); | |
var p = expando as IDictionary<String, object>; | |
p["A"] = "New val 1"; | |
Console.WriteLine(expando.A); |
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
Для установки плагинов зайти в директорию плагина и запустить "python setup.py install" | |
Может ругаться на отсутствие setuptools, тогда нужно запустить файл http://python-distribute.org/distribute_setup.py |
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
[WebMethod] | |
public static void SomeMethod(int paramA, string paramB) | |
{ | |
... | |
} | |
$.ajax({ | |
type: "POST", | |
contentType: "application/json; charset=utf-8", | |
url: window.location.href + "/SomeMethod", |
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
import sys | |
import pprint | |
def pretty_print(object): | |
class decoder_stream: | |
def write(self, s): | |
if s.startswith("'") and s.endswith("'"): | |
s = "'%s'" % s[1:-1].decode('string_escape') | |
elif s.startswith("u'") and s.endswith("'"): | |
s = "u'%s'" % s[2:-1].decode('unicode_escape').encode('utf8') |
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
$.ajax({ | |
type: "POST", | |
contentType: "application/json; charset=utf-8", | |
url: window.location.href + "/SomeMethod", | |
data: { paramA : valueA, paramB : valueB }, | |
dataType: 'json', | |
success: function (response) { | |
... | |
} | |
}); |
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
hg grep --all "PATTERN" FILENAME |
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
## Ignore Visual Studio temporary files, build results, and | |
## files generated by popular Visual Studio add-ons. | |
# User-specific files | |
*.suo | |
*.user | |
*.sln.docstates | |
# Build results |
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 NUnit.Framework; | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace TestUtils |
OlderNewer