Skip to content

Instantly share code, notes, and snippets.

@derwolfe
derwolfe / foo.clj
Created March 23, 2016 15:00
recorder
cloudpassage-reporter.core> (defn record-my-actions [fn & args]
(str (resolve (quote fn)) " args:" args))
#'cloudpassage-reporter.core/record-my-actions
cloudpassage-reporter.core> (record-my-actions count 1 2 3)
"#'clojure.core/fn args:(1 2 3)”
@derwolfe
derwolfe / cryptography-traceback.txt
Created January 5, 2016 14:38
wheel failing to build with pypy-4.0.1+ds
running install_scripts
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-v7Avhg/cryptography/setup.py", line 318, in <module>
**keywords_with_side_effects(sys.argv)
File "/usr/lib/pypy/lib-python/2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/pypy/lib-python/2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/pypy/lib-python/2.7/distutils/dist.py", line 972, in run_command
@derwolfe
derwolfe / gist:7714874
Created November 30, 2013 03:02
raw header returned
[('Date', ['Sat, 30 Nov 2013 03:01:37 GMT']),
('Last-Modified', ['Sat, 30 Nov 2013 03:01:37 GMT']),
('Accept-Ranges', ['bytes']),
('Content-Type', ['text/plain']),
('Server', ['TwistedWeb/13.1.0'])]
.directive('sides', function () {
return {
// this seems to solve the problem - don't use link, use a built in controller.
controller: function ($scope) {//, elem, attrs) {
$scope.sides = [
{ Name: 'Buy', Id: 1 },
{ Name: 'Sell', Id: -1 }
];
$scope.side = $scope.sides[0];
},
.directive('sides', function() {
// not working
return {
scope: {
sides: [
{ Name: 'Buy', Id: 1 },
{ Name: 'Sell', Id: -1 }
]
},
restrict: 'A',
var app = angular.module('App', ['restangular']);
app.config(function (RestangularProvider) {
RestangularProvider.setBaseUrl('/api');
RestangularProvider.setDefaultHeaders({
"headers": { "common": { "Accept": "application/json" } }
});
});
// service that fetches all of the static information that will be needed
angular.module('App', ['restangular'])
.config(function(RestangularProvider) {
RestangularProvider.setBaseUrl('/api');
RestangularProvider.setDefaultHeaders({
"headers": { "common": { "Accept": "application/json" } }
});
})
.service('StaticsService', ['$scope', 'Restangular',
function($scope, Restangular) {
$scope.commodities = Restangular.all('commodities').getList();
@derwolfe
derwolfe / gist:7320407
Last active December 27, 2015 11:39
standalone ping check config
{
"checks": {
"ping_check": {
"handlers": ["default"],
"command": "/etc/sensu/plugins/check-http.rb -p http://www.rmienergy.com",
"interval": 5,
"standalone": true,
}
}
}
using Nancy;
using Nancy.Testing;
using Xunit;
using df_nancy.Modules.api;
namespace df_tests.ApiTests
{
public class PositionApiTests
{
[Fact]
#! /bin/sh
# Start from the repository root.
cd ./$(git rev-parse --show-cdup)
# Delete .pyc files and empty directories.
echo "Deleting pyc files."
find . -name "*.pyc" -delete
find . -type d -empty -delete