Skip to content

Instantly share code, notes, and snippets.

View rlbisbe's full-sized avatar

Roberto Luis Bisbe rlbisbe

View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.AspNet.SignalR;
namespace WebApplication1
{
public class DocumentHub : Hub
{
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="/Scripts/jquery-1.6.4.js"></script>
<script src="/Scripts/jquery.signalR-2.0.3.js"></script>
<script src="/Scripts/jquery.layout.js"></script>
<script src="/signalr/hubs"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/ace.js"></script>
@rlbisbe
rlbisbe / Source.cs
Last active August 29, 2015 14:05
UppercaseCounter Kata
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Sample
{
public class UppercaseSearcher
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Sample.WithLimits
{
class UppercaseSearcher
{
function Promise(){
var self = this;
var thenCallback = null;
var failCallback = null;
var alwaysCallback = null;
self.then = function(callback){
thenCallback = callback;
return self;
@rlbisbe
rlbisbe / gist:83d743d465210db73720
Last active September 13, 2015 11:34
Configure SQL Server
# set-executionpolicy unrestricted
function Disable-InternetExplorerESC {
$AdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}"
$UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}"
Set-ItemProperty -Path $AdminKey -Name "IsInstalled" -Value 0 -Force
Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0 -Force
Stop-Process -Name Explorer -Force
Write-Host "IE Enhanced Security Configuration (ESC) has been disabled." -ForegroundColor Green
}
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Disable-InternetExplorerESC
Install-WindowsUpdate
Disable-MicrosoftUpdate
cinst IIS-WebServerRole -source windowsfeatures
def chop (target: Int, searchBox: Array[Int]) : Int = {
val size = searchBox.size
if (size == 0) {
return -1
}
if (size == 1){
if(searchBox(0) == target){
return 0
} else {
def assert(expected: Int, actual: Int){
if(expected == actual){
println("OK");
}
else {
println("Error, expected: " + expected + " actual: "+ actual);
}
}
def main(args: Array[String]){
test(-1, 2, Array.emptyIntArray)
test(0, 1, Array(1,2,3,4,5))
test(2, 3, Array(1,2,3,4,5))
test(2, 3, Array(1,2,3))
test(0, 1, Array(1))
test(4, 5, Array(1,2,3,4,5))
test(3, 4, Array(1,2,3,4,5))
test(1, 2, Array(1,2,3,4,5))
test(-1, 0, Array(1,2,3,4,5))