Skip to content

Instantly share code, notes, and snippets.

View muratg's full-sized avatar

Murat Girgin muratg

View GitHub Profile
@muratg
muratg / download_prodcon1.py
Last active November 5, 2018 22:42
Download a given ProdConV1 build from a given origin
import urllib.request as UR
import xml.etree.ElementTree as ET
# ------------------------------------------------------------------------------------------------------------------------------------------------
def download_nupkgs(build_xml_url, origin_build_names):
### HELPER FUNCTIONS
def get_build_xml(build_xml_path):
@muratg
muratg / nupkg_multitarget.py
Created June 30, 2017 23:17
4 liner to get the list of nuspecs which multi-target. Usage: python nupkg_multitarget <SHIP_FOLDER_LOCATION>
import zipfile, os, re, sys
for nuspec_path in [(re.sub('(\.)(\d+)\.(\d+)\.(\d+)(.)*','', f) + '.nuspec', sys.argv[1] + '\\' + f) for f in os.listdir(sys.argv[1])]:
with zipfile.ZipFile(nuspec_path[1], 'r') as nupkg_file, nupkg_file.open(nuspec_path[0]) as nuspec_string:
all_targetFrameworks = re.findall('<group targetFramework="(.*?)">', str(nuspec_string.read()))
if len(all_targetFrameworks) > 1: print(nuspec_path[0] + ": ["+ ", ".join(all_targetFrameworks) + "]")
@muratg
muratg / repro.md
Last active April 28, 2016 20:33
Repro for aspnet.home.issues.1414

Pasting here.

{
  "locked": false,
  "version": 2,
  "targets": {
    "DNX,Version=v4.5.1": {
      "AutoMapper/4.2.1": {
        "type": "package",
@muratg
muratg / Program.fs
Created March 26, 2014 04:03
Queue implementation using linked list
module QueueWithLL =
type Node<'T> = {
Item: 'T
mutable Next: Option<Node<'T>>
}
let node (x:'T) = { Item = x; Next = None }
type Queue<'T> = {
@muratg
muratg / gist:9383512
Created March 6, 2014 06:21
keybase.md
### Keybase proof
I hereby claim:
* I am muratg on github.
* I am murat (https://keybase.io/murat) on keybase.
* I have a public key whose fingerprint is 24D2 B6FE 795C D4A3 2BB4 D710 7063 5EF3 DB90 8E9A
To claim this, I am signing this object:
@muratg
muratg / jabbr.types.d.ts
Last active December 28, 2015 03:49
JabbR definitions file
/* Sample code -- create a .ts file, and paste the following to get started
/// <reference path="types.d.ts" />
/// <reference path="signalr.d.ts" />
// Proxies
var monitor: IMonitorProxy = (<any>$.connection).monitor;
var chat: IChatProxy = (<any>$.connection).chat;
// Client implementations go here... add some functions.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity;
namespace MyApplication
{
public class MyEntity
@muratg
muratg / wolfram.fsx
Created November 28, 2012 20:03
Wolfram's 1D cellular automation in F# console
(*
A simple F# script to display Wolfram's basic 1D cellular automaton rules as text output [1]
-mg
*)
let runWolframRule rule cells iterations =
let compute cells ith rule =
let withBorders = 0 :: cells @ [0];
@muratg
muratg / monadicParser.fs
Created November 28, 2012 19:55
Monadic parsing in F# - translated from "Monadic parsing in Haskell" paper by Graham Hutton & Erik Meijer
// ===================
// Monadic parsing in F#
// by Murat Girgin
// Translated from "Monadic parsing in Haskell" paper by Graham Hutton & Erik Meijer
// Source: http://www.cs.nott.ac.uk/~gmh/pearl.pdf
// ===================
#nowarn "40"
// ---------------------------------------------------------------------------------
@muratg
muratg / mocha.d.ts
Created November 28, 2012 19:49
TypeScript declarations (typings) file for Mocha JavaScript testing framework
// mocha.d.ts
//
// Mocha (c) 2011-2012 TJ Holowaychuk <tj@vision-media.ca>
//
// Hand written by Murat Girgin
// based on http://visionmedia.github.com/mocha/
//
declare var describe: {
(testDescription: string, f: Function): any;