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 static class Coroutine { | |
public static void BeginExecute(IEnumerable<Promise> enumerable) { | |
MoveNext(enumerable.GetEnumerator()); | |
} | |
static void MoveNext(IEnumerator<Promise> enumerator) { | |
if (enumerator.MoveNext()) { | |
var promise = enumerator.Current; | |
promise.Current = promise.Task(); | |
promise.Current._CallBack = () => MoveNext(enumerator); |
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
@echo off | |
pushd "%PROGRAMFILES%\IIS Express" | |
for /F %%i in ('appcmd list sites /text:NAME') do ( | |
echo %%i | |
appcmd delete site %%i | |
) | |
popd |
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 systemJsLoader = { | |
loadComponent: function (name, templateConfig, callback) { | |
if (templateConfig.systemjs) { | |
SystemJS.import(templateConfig.systemjs) | |
.then(function (viewModelCtor) { | |
callback({ | |
createViewModel: function (params, componentInfo) { | |
return viewModelCtor.viewModel(params, componentInfo); | |
}, | |
template: ko.utils.parseHtmlFragment(viewModelCtor.template) |
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
class ApiClient { | |
private string connectionString; | |
ctor(String connectionString) { | |
this.connectionString = connectionString; | |
} | |
public string FazAlgumaCoisa(string parametros) { | |
using (var conexao = new ConexaoComDb(connectionString)) { | |
return conexao.PegaDados(parametros); |
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
@echo off | |
@set path=%PATH%;"%PROGRAMFILES\IIS EXPRESS"; | |
:: echo current directory is: %~dp0 | |
:: echo argument 1 is: %1 | |
set "HTTPPORT=9901" | |
set "PUBLIC=%~dp0%wwwroot" | |
set "HOME=%~dp0%iishome" | |
if not [%1]==[] ( | |
set httpport=%1 | |
) |
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
/* | |
* read-only date display with momentjs | |
* use like this: data-bind="moment: dateVar, format: 'YYYY-MM-DD'" | |
* The "format" is optional and will default to "MM/DD/YYYY" | |
*/ | |
ko.bindingHandlers.moment = { | |
update: function (element, valueAccessor, allBindingsAccessor, viewModel) { | |
var val = valueAccessor(); | |
var date = moment(ko.utils.unwrapObservable(val)); |
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
(function () { | |
String.prototype.format = function () { | |
var args = arguments; | |
return this.replace(/\{\{|\}\}|\{(\d+)\}/g, function (m, n) { | |
if (m == "{{") { return "{"; } | |
if (m == "}}") { return "}"; } | |
return args[n]; | |
}); | |
}; |
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
Ext.define('App.controller.Clientes', { | |
extend: 'Ext.app.Controller', | |
init: function () { | |
this.control({ | |
"grid": { | |
meuevento: function (record) { //captura o evento que será disparado pelo grid, quando o ícone for clicado | |
console.log(record); | |
}, |
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 System; | |
using System.Collections.Generic; | |
using System.Drawing; | |
using System.Drawing.Imaging; | |
using System.Drawing.Printing; | |
using System.IO; | |
using Microsoft.Reporting.WinForms; | |
// ReSharper disable once CheckNamespace | |
namespace JonePolvora { |
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 System; | |
using System.Collections.Generic; | |
using System.ComponentModel.DataAnnotations; | |
using System.Data; | |
using System.Data.Entity; | |
using System.Data.Entity.Infrastructure; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Text; | |
using System.Threading; |