Skip to content

Instantly share code, notes, and snippets.

View shirhatti's full-sized avatar

Sourabh Shirhatti shirhatti

View GitHub Profile
@shirhatti
shirhatti / project.json
Created July 2, 2014 23:23
project.json for ASP.NET K project
{
"version": "0.1-alpha-*",
"dependencies": {
"Microsoft.AspNet.Diagnostics": "0.1-alpha-build-0682",
"Microsoft.AspNet.Hosting": "0.1-alpha-build-0572",
"Microsoft.AspNet.Mvc": "0.1-alpha-build-1268",
"Microsoft.AspNet.Server.WebListener": "0.1-alpha-build-0520"
},
"commands": {
"web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001"
@shirhatti
shirhatti / roslyn.sh
Created July 23, 2014 18:35
Roslyn on mac
#!/bin/bash
git clone https://git01.codeplex.com/roslyn
git reset --hard 2ebbf78de5377dba1ec7d4420858c320fa38d0f3
wget http://tirania.org/roslyn-patches/0001-Backport-from-Marek-Allow-to-bootstrap-with-mcs.patch
wget http://tirania.org/roslyn-patches/0002-Backport-from-Marek-Disable-assemblies-not-available.patch
wget http://tirania.org/roslyn-patches/0003-Backport-from-Marek-Make-some-code-portable.patch
wget http://tirania.org/roslyn-patches/0004-Update-wrong-merge.patch
wget http://tirania.org/roslyn-patches/0005-Add-another-bootstrap-workaround.patch
wget http://tirania.org/roslyn-patches/0006-More-bootstrap-changes.patch
wget http://tirania.org/roslyn-patches/0007-Add-build-files.patch
@shirhatti
shirhatti / node.js
Created July 23, 2014 21:37
dummyserver
var http = require('http');
test_data = [
["test_1", "test_1_data"],
["test_2", "test_2_data"],
["test_3", "test_3_data"]
]
http.createServer(function (req, res) {
switch(req.url) {
case '/complete':

Launch Sublime Text 3 from the Mac OS X Terminal

tl;dr

  • Open Terminal
  • Type ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime
  • Type sublime

Give me the full story

C:\src\test\MvcApplication1> ls
Directory: C:\src\test\MvcApplication1
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 7/29/2014 10:03 AM Controllers
d---- 7/29/2014 10:03 AM Models
{
"ProjectName": "DesignTimeHostDemo",
"Configurations": [
{
"FrameworkName": "net45",
"LongFrameworkName": ".NETFramework,Version=v4.5",
"FriendlyFrameworkName": ".NET Framework 4.5",
"CompilationSettings": {
"LanguageVersion": 6,
"Defines": [
@shirhatti
shirhatti / gist:24b8a0910e003c73d20a
Created August 8, 2014 18:41
Launch Sublime from Powershell
Set-Alias sublime 'C:\Program Files\Sublime Text 3\sublime_text.exe'
@shirhatti
shirhatti / error.log
Created August 14, 2014 23:47
KPM restore fails
azureuser@shirhatti:~/tmp/MvcApplication1$ kpm restore
Restoring packages for /home/azureuser/tmp/MvcApplication1/project.json
Attempting to resolve dependency MvcApplication1 >= 0.1-alpha-SNAPSHOT
Attempting to resolve dependency Microsoft.AspNet.Diagnostics >= 1.0.0
Attempting to resolve dependency Microsoft.AspNet.Hosting >= 1.0.0
Attempting to resolve dependency Microsoft.AspNet.Mvc >= 6.0.0
Attempting to resolve dependency Microsoft.AspNet.Server.WebListener >= 1.0.0
Attempting to resolve dependency Kestrel >= 1.0.0
Attempting to resolve dependency mscorlib >=
Attempting to resolve dependency System >=
azureuser@shirhatti:~$ mcs -r System.Net.Http.dll test.cs
warning CS8029: Compatibility: Use -r:LIBRARY instead of -r library
azureuser@shirhatti:~$ mono test.exe
Unhandled Exception:
System.AggregateException: One or more errors occurred ---> System.Net.WebException: Error: SendFailure (Error writing headers) ---> System.Net.WebException: Error writing headers ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: Invalid certificate received from server. Error code: 0xffffffff800b010a
at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.RemoteValidation (Mono.Security.Protocol.Tls.ClientContext context, AlertDescription description) [0x00000] in <filename unknown>:0
at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.validateCertificates (Mono.Security.X509.X509CertificateCollection certificates) [0x00000] in <filename unknown>:0
at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.Proces
@shirhatti
shirhatti / Notes.md
Last active August 29, 2015 14:10
382V Notes for November 11

#EE382V/379K: Multicore Computing

##Agenda 0. Communicating Sequencer Processes 0. Temporal Logic

##Backus-Naur Form

  • Developed to describe the Syntax of ALGOL
  • Context-free grammar used describe the syntax of programming langauages.