Skip to content

Instantly share code, notes, and snippets.

View knocte's full-sized avatar
💭
F#ing

Andres G. Aragoneses knocte

💭
F#ing
View GitHub Profile
doiejfoifejob
@knocte
knocte / uat.rb
Created September 25, 2012 14:43
some capistrano configuration example
role :app, "#{stage}-someservice.nix.7dig", "#{stage}-someservice.nix.7dig"
set :application, "someservice-api"
set :user, "someuser"
set :deploy_to, "/home/#{user}/www"
set :fqdn, "someservice-api.#{stage}.internal.7dig"
set :config_options,
{
'//add[@key="someDatabase"]/@value' => "User Id=someuser;Password=somepassword;Initial Catalog=someDatabase;Server=someServer;",
'//add[@key="log4net.crm"]/@value' => "someOtherConnString",
@knocte
knocte / gist:3782635
Created September 25, 2012 15:37
nginx config file example
server {
listen 80; ## listen for ipv4
location / {
root /var/www;
index index.html index.htm;
fastcgi_pass unix:/tmp/SOCK-$http_host;
include /etc/nginx/fastcgi_params;
}
}
diff --git a/mcs/class/System/System.Net/WebConnection.cs b/mcs/class/System/System.Net/WebConnection.cs
index 4922fb3..bd505f3 100644
--- a/mcs/class/System/System.Net/WebConnection.cs
+++ b/mcs/class/System/System.Net/WebConnection.cs
@@ -58,6 +58,7 @@ namespace System.Net
object socketLock = new object ();
WebExceptionStatus status;
WaitCallback initConn;
+ Action<HttpWebRequest> initConnDelegate;
bool keepAlive;
@knocte
knocte / gist:5943237
Created July 7, 2013 11:58
Log of `sudo apt-get install mono-complete` with meebey's experimental Mono 3.0 repository in ubuntu 13.04
...
Unpacking libmono-peapi2.0-cil (from .../libmono-peapi2.0-cil_3.0.6+dfsg-1~exp1~pre1_all.deb) ...
Selecting previously unselected package libmono-peapi4.0-cil.
Unpacking libmono-peapi4.0-cil (from .../libmono-peapi4.0-cil_3.0.6+dfsg-1~exp1~pre1_all.deb) ...
Selecting previously unselected package libmono-relaxng2.0-cil.
Unpacking libmono-relaxng2.0-cil (from .../libmono-relaxng2.0-cil_3.0.6+dfsg-1~exp1~pre1_all.deb) ...
Selecting previously unselected package libmono-relaxng4.0-cil.
Unpacking libmono-relaxng4.0-cil (from .../libmono-relaxng4.0-cil_3.0.6+dfsg-1~exp1~pre1_all.deb) ...
Selecting previously unselected package libmono-sharpzip2.6-cil.
Unpacking libmono-sharpzip2.6-cil (from .../libmono-sharpzip2.6-cil_3.0.6+dfsg-1~exp1~pre1_all.deb) ...
@knocte
knocte / 0001-System.Net.IPAddress-Fix-tests-to-pass-in-MS.NET-4.0.patch
Created July 23, 2013 14:54
This should be fixed before adding IPAddress.MapToIPv4/6 new APIs to Mono (https://github.com/mono/mono/pull/641)
From 937a30e99c9e2641e96fc7efc8776d96a5a98115 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20G=2E=20Aragoneses?= <knocte@gmail.com>
Date: Tue, 23 Jul 2013 16:52:14 +0200
Subject: [PATCH] [System.Net.IPAddress] Fix tests to pass in MS.NET 4.0
profile
Apparently the 4.0 MS profile doesn't parse IP addresses with spaces
inside. The behaviour of parsing null is also different. Plus this
commit also includes some cases which don't pass on Mono yet (such
as "4294967296").
@knocte
knocte / gist:6444504
Created September 5, 2013 00:20
disadvantages of some programming languages
* Rust: already mentioned it's maybe too early to use (it didn't reach 1.0 and that means that the language keywords, classlibraries APIs, etc, can still change without warning). I like how safe and statically typed it tries to be, but I don't like the fact that it defaults to use manual memory management (non-GC).
* Go: definitely a language that will give a lot to talk about. The only thing I don't like about it is that, even though it uses an error-passing model that may be better than the try-catch model, it makes errors not bubble up (thus ignored) by default, which doesn't look very safe to me.
* Haskell: a very good contender in the functional-paradigm world, however the fact that it doesn't interoperate with other languages at the VM level (like F# or Clojure) makes it a no-go for me.
* Scala: a good static-typing alternative to Java, a bit less verbose, hybrid between functional and object-oriented paradigm, and which runs on the JVM. Disadvantage I see: doesn't default to immutability, like most fun
@knocte
knocte / gist:6444568
Last active December 22, 2015 08:19
disadvantages of some interesting languages
* Rust: already mentioned it's maybe too early to use (it didn't reach 1.0 and that means that the language keywords, classlibraries APIs, etc, can still change without warning). I like how safe and statically typed it tries to be, but I don't like the fact that it defaults to use manual memory management (non-GC).
* Go: definitely a language that will give a lot to talk about. The only thing I don't like about it is that, even though it uses an error-passing model that may be better than the try-catch model, it makes errors not bubble up (thus ignored) by default, which doesn't look very safe to me.
* Haskell: a very good contender in the functional-paradigm world, however the fact that it doesn't interoperate with other languages at the VM level (like F# or Clojure) makes it a no-go for me.
* Scala: a good static-typing alternative to Java, a bit less verbose, hybrid between functional and object-oriented paradigm, and which runs on the JVM. Disadvantage I see: doesn't default to immutability, like most
diff --git a/mono/metadata/sgen-descriptor.h b/mono/metadata/sgen-descriptor.h
index cd53a86..178353a 100644
--- a/mono/metadata/sgen-descriptor.h
+++ b/mono/metadata/sgen-descriptor.h
@@ -172,22 +172,36 @@ sgen_gc_descr_has_references (mword desc)
#ifdef __GNUC__
#define OBJ_BITMAP_FOREACH_PTR(desc,obj) do { \
+g_print ("___in oBJ_BITMAP_FOREACH_PTR\n"); \
/* there are pointers */ \
@knocte
knocte / gist:6934896
Created October 11, 2013 13:44
replaygain + pad blocks
public bool ReplayGainEnabled {
get { return rgvolume != null; }
set {
if (value && rgvolume == null) {
visible_sink.SetBlocked (true, InsertReplayGain);
Log.Debug ("Enabled ReplayGain volume scaling.");
} else if (!value && rgvolume != null) {
visible_sink.SetBlocked (false, RemoveReplayGain);
Log.Debug ("Disabled ReplayGain volume scaling.");
}