Skip to content

Instantly share code, notes, and snippets.

@bsuh
bsuh / page_controller.ex
Last active July 16, 2020 20:00
proxying responses
defmodule PhoenixTest.PageController do
use PhoenixTest.Web, :controller
def index(conn, _params) do
render conn, "index.html"
end
def proxy(conn, params) do
query_string = conn.query_string
path = Enum.join(params["path"], "/")
@bsuh
bsuh / gist:bab7eeb8bda2421ac01c760c90668100
Last active September 17, 2017 16:58
emacs-25.1-rc1 24-bit color
diff --git a/lisp/term/tty-colors.el b/lisp/term/tty-colors.el
index 3ea26b8..c614825 100644
--- a/lisp/term/tty-colors.el
+++ b/lisp/term/tty-colors.el
@@ -1009,11 +1009,21 @@ tty-color-desc
Value is a list of the form (NAME INDEX R G B). The returned NAME or
RGB value may not be the same as the argument COLOR, because the latter
might need to be approximated if it is not supported directly."
+ ;; Here we are expeting to return (name idx (values)), be nice if we
+ ;; could just return the rgb, there is one use in
@bsuh
bsuh / faster_readbyte_from_file.diff
Created September 11, 2015 20:54
Faster reading of bytes from files in Emacs
diff --git a/src/lread.c b/src/lread.c
index e1a4b33..4f17e39 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -467,7 +467,7 @@ readbyte_from_file (int c, Lisp_Object readcharfun)
}
block_input ();
- c = getc (instream);
+ c = getc_unlocked (instream);
diff --git a/git-svn.perl b/git-svn.perl
index 05eced0..6127314 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -703,17 +703,19 @@ sub merge_merge_info {
}
sub populate_merge_info {
- my ($d, $gs, $uuid, $linear_refs, $rewritten_parent) = @_;
+ my ($d, $gs, $uuid, $linear_refs, $rewritten_parent, $merge_info_path) = @_;
@bsuh
bsuh / gist:f8b12b0d7e15f75f9a7c
Created November 3, 2014 20:01
Emacs 24.4 csharp-mode fix patch
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index 1606cfb..db292f0 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -1834,11 +1834,11 @@ system."
immediately, i.e. at the same time as the `c-lang-defconst' form
itself is evaluated."
;; Evaluate at macro expansion time, i.e. in the
- ;; `cl-macroexpand-all' inside `c-lang-defconst'.
+ ;; `macroexpand-all' inside `c-lang-defconst'.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:libxslt="http://xmlsoft.org/XSLT/namespace"
version="1.0" exclude-result-prefixes="libxslt">
<xsl:output method="xml" indent="yes"/>
<xsl:variable name="test">
<a>
<b/>
</a>
</xsl:variable>
<xsl:template match="/">