This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function clickIt() { | |
var $form = $("form"); //the only form on the page is the elevator button of interest. | |
var postURL = $form.attr("action"); //post url of the form | |
var postData = {}; | |
var inputs = $("input", $form); | |
for (var i = inputs.length; i--;) { | |
// serialize the form elements into an object | |
postData[inputs.eq(i).attr("name")] = inputs.eq(i).val(); | |
} | |
//clicking the elevator button of interest was submitting a form contained w/in it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name localhost; | |
root /swelly/static; | |
location / { | |
try_files index.html =404; | |
} | |
location /api { | |
proxy_pass http://127.0.0.1:3000/api; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Bunch(dict): | |
def __init__(self, *args, **kwds): | |
super(Bunch, self).__init__(*args, **kwds) | |
self.__dict__ = self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// in AppDelegate | |
// | |
// Initialize RestKit Shared Client | |
RKObjectManager *objectManager = [RKObjectManager objectManagerWithBaseURLString:_baseURL]; | |
// Enable automatic network activity indicator management | |
objectManager.client.requestQueue.showsNetworkActivityIndicatorWhenBusy = YES; | |
// Initialize object store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fn = function(one, two, three, callback) { | |
var args = Array.prototype.slice.apply(arguments); | |
var lastArg = args.pop() | |
if (callback !== lastArg && typeof lastArg == 'function') { | |
callback = lastArg; | |
arguments[args.length] = undefined; // not -1 bc of pop above | |
} | |
// Handle undefined values, by setting default value | |
// .. Rest of function .. | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var compose = function() { | |
var funcs = Array.prototype.slice.apply(arguments); | |
return function(arg) { | |
return funcs.reduce(function(arg, fn) { | |
return fn.call(this, arg); | |
}, arg); | |
}; | |
}; | |
var and = function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function objectToQuerystring (obj) { | |
return Object.keys.reduce(function (str, key, i) { | |
var delimiter, val; | |
delimiter = (i === 0) ? '?' : '&'; | |
key = encodeURIComponent(key); | |
val = encodeURIComponent(obj[key]); | |
return [str, delimiter, key, '=', val].join(''); | |
}, ''); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ERROR: apport (pid 23850) Tue Sep 1 21:07:32 2015: Unhandled exception: | |
Traceback (most recent call last): | |
File "/usr/share/apport/apport", line 54, in drop_privileges | |
stat = os.stat('/proc/' + pid) | |
FileNotFoundError: [Errno 2] No such file or directory: '/proc/43' | |
During handling of the above exception, another exception occurred: | |
Traceback (most recent call last): | |
File "/usr/share/apport/apport", line 276, in <module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# Collect information about a crash and create a report in the directory | |
# specified by apport.fileutils.report_dir. | |
# See https://wiki.ubuntu.com/Apport for details. | |
# | |
# Copyright (c) 2006 - 2011 Canonical Ltd. | |
# Author: Martin Pitt <[email protected]> | |
# | |
# This program is free software; you can redistribute it and/or modify it |
OlderNewer