Skip to content

Instantly share code, notes, and snippets.

@bowsersenior
bowsersenior / nmap-simple.md
Created November 3, 2012 06:11
Sample gauntlt attack
Feature: simple nmap attack (sanity check)

  Background:
    Given "nmap" is installed
    And the following profile:
      | name | value |
      | hostname | example.com |

 Scenario: Verify server is available on standard web ports
require 'openssl'
require 'base64'
require 'uri'
# inspired by Amazon's AWS auth (also used by Twilio)
# see:
# * http://www.thebuzzmedia.com/designing-a-secure-rest-api-without-oauth-authentication/
# * https://github.com/amazonwebservices/aws-sdk-for-ruby/blob/master/lib/aws/core/signer.rb
# * https://github.com/amazonwebservices/aws-sdk-for-ruby/blob/master/lib/aws/core/signature/version_4.rb
# * https://github.com/twilio/twilio-ruby/blob/master/lib/twilio-ruby/util/request_validator.rb
@bowsersenior
bowsersenior / constructorDemo.js
Last active December 14, 2015 19:28
Demo of JavaScript constructor property. Illustrates that the constructor property is set automatically by JavaScript, but is overwritten when a custom prototype is assigned, necessitating the constructor to be explicitly set in the prototype. For more info, refer to http://nerdstuckathome.wordpress.com/2012/11/06/a-quick-digression-about-the-co…
function Nuttin() {};
function Sumtin() {};
Sumtin.prototype = { foo: function(){} };
function SumtinElse() {};
SumtinElse.prototype = { bar: function(){}, constructor: SumtinElse };
function AnotherSumtinElse() {};
Object.defineProperty(AnotherSumtinElse, "prototype", { value: {bar: function(){}, constructor: AnotherSumtinElse }});
# My pimped out unicorn config, with incremental killof
# and all the latest capistrano & bundler-proofing
# @jamiew :: http://github.com/jamiew
application = "000000book.com"
environment = ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'production'
app_path = "/srv/#{application}"
bundle_path = "#{app_path}/shared/bundle"
timeout 30

This is all based on the [alpha release][1].

Properties

From the built-in help system:

For many settings TextMate will look for a .tm_properties file in the current folder and in any parent folders (up to the user’s home folder).

These are simple setting = value listings where the value is a format string in which other variables can be referenced.

@bowsersenior
bowsersenior / build.gradle
Created March 26, 2021 20:12 — forked from medvedev/build.gradle
Gradle task that prints total dependencies size and (dependency+(size in kb)) list sorted by size desc
...
/* Tested with Gradle 6.3 */
tasks.register("depsize") {
description = 'Prints dependencies for "default" configuration'
doLast() {
listConfigurationDependencies(configurations.default)
}
}