Skip to content

Instantly share code, notes, and snippets.

Mani Tadayon bowsersenior

Block or report user

Report or block bowsersenior

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:ce05fa27e78f8a9ea4bf45a38cea2e15

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.

View unicorn.rb
# 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
@bowsersenior
bowsersenior / constructorDemo.js
Last active Dec 14, 2015
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…
View constructorDemo.js
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 }});
View simple_digest_auth.rb
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 / nmap-simple.md
Created Nov 3, 2012
Sample gauntlt attack
View nmap-simple.md
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
@bowsersenior
bowsersenior / README.md
Created Aug 18, 2012
Gauntlt with turnip
View README.md

Proof of concept of using Turnip as the engine for gauntlt

How to use this code

TL;DR

$ git clone git://gist.github.com/3388412.git spec
$ gem install turnip aruba
$ rspec -r ./spec/spec_helper.rb -r ./spec/steps/gauntlt_steps.rb spec/nmap_turnip.attack --format documentation
View mountain-lion-brew-setup.markdown

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from http://developer.apple.com. You will not be able to submit apps to any stores using this XCode version, so turn away if that is something you might want to do.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@bowsersenior
bowsersenior / every_combo.rb
Created Jul 25, 2012
Find every possible combination of a hash
View every_combo.rb
class Hash
def every_combo
arr = self.to_a
1.upto(arr.size).inject([]) do |memo, n|
memo << arr.combination(n).to_a.map{|a| Hash[a] }
memo
end.flatten
end
end
View rbenv-helpers.plugin.zsh
# custom current_gemset check
function my_rbenv_current_gemset(){
rbenv gemset active &>/dev/null
if [ $? -eq 0 ]; then
local gemset="$(rbenv gemset active 2>/dev/null)"
echo "$gemset"
else # an error status means no gemsets
echo "NO_GEMSET"
fi
@bowsersenior
bowsersenior / gist:2997869
Created Jun 26, 2012 — forked from Victa/gist:1485536
My Textmate 2 .tm_properties
View gist:2997869
# Basic Settings
#
fontName = "Monaco"
fontSize = 12
# Extra files to include
#
myExtraIncludes = ".tm_properties,.htaccess,.gitignore"
fileBrowserGlob = "{*,$myExtraIncludes}"
include = "{$include,$myExtraIncludes}"
You can’t perform that action at this time.