Skip to content

Instantly share code, notes, and snippets.

View pingles's full-sized avatar

Paul Ingles pingles

View GitHub Profile
configure :production do
Rack::Request.add_scheme_mapping("https") do |env|
env['MY_CUSTOM_HTTPS_HEADER'] == "on"
end
end
(matrix (repeat 10 (range 1 4)))
; [1.0000 2.0000 3.0000
; 1.0000 2.0000 3.0000
; 1.0000 2.0000 3.0000
; 1.0000 2.0000 3.0000
; 1.0000 2.0000 3.0000
; 1.0000 2.0000 3.0000
; 1.0000 2.0000 3.0000
; 1.0000 2.0000 3.0000
; 1.0000 2.0000 3.0000
(defn funky-prediction
[model x y]
;; something complex :)
1)
(deftest prediction-test
(let [model ; first arg
x ; other arg
predict (partial funky-prediction model x)]
(is (= 1 (redict :cat))
(ns error-example)
(defn calculation
[x]
(if (= x 5)
(throw (RuntimeException. "Hipsters!"))
x))
(map calculation (range 1 20))
;; RuntimeException Hipsters! error-example/calculation (NO_SOURCE_FILE:30)
(ns error-example)
(declare ^{:dynamic true} handle-error)
(defn calculation
[x]
(if (= x 5)
(handle-error x)
x))
(ns error-example)
(declare ^{:dynamic true} handle-error)
(defn- calculation
[x]
(if (= (mod x 5) 0)
(do (handle-error x)
nil)
x))
backend legacy
mode http
timeout connect 10s
timeout server 30s
balance roundrobin
server bigip 213.52.205.36:80 weight 1 maxconn 512
backend elb
mode http
timeout connect 10s
$(".switch form").submit(function() {
$("").interstitial('open', {
'url' : '/gas-electricity/moving-home/completing-your-switch/?' + $(this).serialize()
});
$.ajax({
type: "POST",
url: $(this).attr("action"),
data: $(this).serialize(),
error: function(jq, textStatus, errorThrown) {
diff --git a/src/nsterm.m b/src/nsterm.m
index e768c24..5bf6ce3 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1161,8 +1161,10 @@ x_set_window_size (struct frame *f, int change_grav, int cols, int rows)
f->scroll_bar_actual_width = NS_SCROLL_BAR_WIDTH (f);
compute_fringe_widths (f, 0);
+
+ BOOL inFullScreen = ([window styleMask] & NSFullScreenWindowMask) == NSFullScreenWindowMask;
require 'formula'
# NOTE:
#
# Two exciting enhancements in GCC 4.6.0 are currently unavailable.
#
# Link-time optimization (LTO) is broken due to changes in XCode 3.2.6 and 4.0.
# This should be fixed in GCC 4.6.1:
# http://lists.macosforge.org/pipermail/macports-dev/2011-March/014278.html
#