Skip to content

Instantly share code, notes, and snippets.

View skull-squadron's full-sized avatar
💭
*aaS unreleased project in Elixir, Rust, Typescript, Kafka, and k8s

🏴‍☠️ skull-squadron

💭
*aaS unreleased project in Elixir, Rust, Typescript, Kafka, and k8s
  • (stealth)
  • ATX
  • 01:38 (UTC -06:00)
View GitHub Profile
@skull-squadron
skull-squadron / myutils.py
Created August 29, 2011 07:53
Shred the contents of python objects.
"""
(c) 2011 Barry Allard <[email protected]>
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
@skull-squadron
skull-squadron / find_ssh_host_name.py
Created September 6, 2011 17:49
Given a host, match to the actual ssh hostname per standard ssh_config files.
#!/usr/bin/env python
"""
find_ssh_host_name.py
Given a hostname on the command line, return the hostname from standard ssh_config sources on stdout.
(c) 2011 Barry Allard <[email protected]>
require ["rubygems"]
require ["absolute_time"] (stats bypassed 1)
require ["rubygems/version"] (stats bypassed 1)
require ["rubygems/requirement"] (stats bypassed 1)
require ["rubygems/version"] (stats bypassed 1)
require ["rubygems/version"] (stats bypassed 1)
require ["rubygems/deprecate"] (stats bypassed 1)
require ["rubygems/platform"] (stats bypassed 1)
require ["rubygems/deprecate"] (stats bypassed 1)
require ["rubygems/deprecate"] (stats bypassed 1)
patched /Volumes/Users/barry/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb to show requires, loads and imports. RBDEBUG_REQUIRE shows, RBDEBUG_HIDE hides
require ["rubygems"]
require ["absolute_time"] (stats bypassed 1)
require ["rubygems/version"] (stats bypassed 1)
require ["rubygems/requirement"] (stats bypassed 1)
require ["rubygems/version"] (stats bypassed 1)
require ["rubygems/version"] (stats bypassed 1)
require ["rubygems/deprecate"] (stats bypassed 1)
require ["rubygems/platform"] (stats bypassed 1)
require ["rubygems/deprecate"] (stats bypassed 1)
@skull-squadron
skull-squadron / gist:2023444
Created March 12, 2012 17:15
Time yer loads and requires
# Usage: MRI put at the top of custom_require.rb
#
# ~/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb
# This is crappy/untested proof-of-concept code, do not use it in production. It will fail.
# Unlikely to be threadsafe either.
# Don't run this on anything you care about.
# No warranties, express or implied. GPL v3 license.
if ENV['RBDEBUG_REQUIRE'] && !ENV['RBDEBUG_HIDE']
patched /Volumes/Users/barry/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb to show requires, loads and imports. RBDEBUG_REQUIRE shows, RBDEBUG_HIDE hides
rubygems ...
absolute_time (stats bypassed 1)
rubygems/version (stats bypassed 1)
rubygems/requirement (stats bypassed 1)
rubygems/version (stats bypassed 1)
rubygems/version (stats bypassed 1)
rubygems/deprecate (stats bypassed 1)
rubygems/platform (stats bypassed 1)
rubygems/deprecate (stats bypassed 1)
@skull-squadron
skull-squadron / require_profiling__custom_require.rb
Created March 12, 2012 19:18
hacking up custom_require to show library load times. (HINT: This is silly, use a debugger!)
# Usage: MRI put at the top of custom_require.rb
#
# ~/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb
# This is crappy/untested proof-of-concept code, do not use it in production. It will fail.
# Unlikely to be threadsafe either.
# Don't run this on anything you care about.
# No warranties, express or implied. GPL v3 license.
if ENV['RBDEBUG_REQUIRE'] && !ENV['RBDEBUG_HIDE']
@skull-squadron
skull-squadron / fix_rvm_permissions.sh
Created March 13, 2012 22:50
fix rvm permissions
#!/bin/sh
find ~/.rvm -type d -print0 | xargs -0L1 chmod 0755
find ~/.rvm -type f -print0 | xargs -0L1 chmod 0644
find ~/.rvm -type f -print0 | xargs -0L1 file | grep ' exec' | cut -d: -f1 | tee /dev/stderr | xargs -L1 chmod 0755
@skull-squadron
skull-squadron / gist:2038710
Created March 14, 2012 19:05
ansi 256 color swatch sample in ruby
#!/usr/bin/env ruby
#
# Usage: 256swatch [-b [foreground [test pattern]]]
#
# option description default
# -----------------------------------------------------------
#
# -b print background swatches instead normal
#
# foreground force foreground (decimal) normal
@skull-squadron
skull-squadron / New Folder From Selection.applescript
Last active December 12, 2015 01:08
New Folder From Selection (Service that works with 1+ files instead of 2+)
on run {input, parameters}
tell application "Finder"
set thePath to first item of input
set {dispName, nameExt, isHidden} to the {displayed name, name extension, extension hidden} of thePath
if isHidden or nameExt is equal to "" then
dispName
else