Skip to content

Instantly share code, notes, and snippets.

View rickmzp's full-sized avatar

Rick Martínez rickmzp

  • LineLeap
  • New York, NY
  • 03:56 (UTC -04:00)
  • X @rickmzp
View GitHub Profile
{"contents":{"launch":{"version":"0.2.0","configurations":[{"type":"node","request":"attach","name":"Attach to node","port":9229},{"name":"Debug Local File","type":"Ruby","request":"launch","cwd":"${workspaceRoot}","program":"${workspaceRoot}/main.rb"},{"name":"Debug NextJS-Rails","type":"Ruby","request":"launch","cwd":"${workspaceRoot}","program":"${workspaceRoot}/bin/bundle exec nextjs-rails-server"},{"name":"Listen for rdebug-ide","type":"Ruby","request":"attach","cwd":"${workspaceRoot}","remoteHost":"127.0.0.1","remotePort":"1234","remoteWorkspaceRoot":"${workspaceRoot}"},{"name":"Rails server","type":"Ruby","request":"launch","cwd":"${workspaceRoot}","program":"${workspaceRoot}/bin/rails","args":["server"]},{"name":"RSpec - all","type":"Ruby","request":"launch","cwd":"${workspaceRoot}","program":"${workspaceRoot}/bin/rspec","args":["-I","${workspaceRoot}"]},{"name":"RSpec - active spec file only","type":"Ruby","request":"launch","cwd":"${workspaceRoot}","program":"${workspaceRoot}/bin/rspec","args":["-I"
// Photoshop Script to Create iPhone Icons from iTunesArtwork
//
// WARNING!!! In the rare case that there are name collisions, this script will
// overwrite (delete perminently) files in the same folder in which the selected
// iTunesArtwork file is located. Therefore, to be safe, before running the
// script, it's best to make sure the selected iTuensArtwork file is the only
// file in its containing folder.
//
// Copyright (c) 2010 Matt Di Pasquale
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com
@rickmzp
rickmzp / gist:6360986
Created August 28, 2013 01:05
Git aliases
alias g='git'
alias ga='git add'
alias gaa='git add --all'
alias gb='git branch'
alias gc='git commit'
alias gca='git commit -a'
alias gco='git checkout'
alias gd='git diff'
alias gdc='git diff --cached'
alias gf='git fetch'
@rickmzp
rickmzp / README
Last active December 18, 2015 19:38 — forked from cwsaylor/gist:8511
Variation on Hashrocket's script for managing the git process
as documented here: http://reinh.com/blog/2008/08/27/hack-and-and-ship.html
Create shell scripts out of each of these, put them in your path (~/bin for example)
chmod 755 them and use like this:
This version of hack is totally different than Hackrockets. I feel that hack implies
that you are getting started, not finishing up. sink is Hashrockets hack.
$ hack branch_name
Test and Implement until done
require 'socket'
socket = TCPSocket.new "192.168.201.133", 1337
socket.puts "GET /8\n\n"
results = {}
total_lines = 0
begin
puts "Scanning..."
@data = open("gettysburg.txt").read
@longest_palindrome = ""
@position = 0
def regex
/#{@data[@position, @longest_palindrome.length + 1].reverse}/
end
@rickmzp
rickmzp / gist:1323454
Created October 28, 2011 20:29 — forked from esteigler/gist:1323445
my updates
require "fog"
require "nokogiri"
def name
@name ||= new_resource.name + "."
end
def value
@value ||= new_resource.value
end
diff --git a/lib/ohai/plugins/rackspace.rb b/lib/ohai/plugins/rackspace.rb
index ee44065..0812206 100644
--- a/lib/ohai/plugins/rackspace.rb
+++ b/lib/ohai/plugins/rackspace.rb
@@ -36,7 +36,7 @@ end
def has_rackspace_mac?
network[:interfaces].values.each do |iface|
unless iface[:arp].nil?
- return true if iface[:arp].value?("00:00:0c:07:ac:01")
+ return true if iface[:arp].value?("00:00:0c:07:ac:01") or iface[:arp].value?("00:00:0c:9f:f0:01")
@rickmzp
rickmzp / serialize_matcher.rb
Created July 14, 2011 23:07 — forked from txus/serialize_matcher.rb
RSpec matcher for serialized ActiveRecord columns
# RSpec matcher to spec serialized ActiveRecord attributes.
#
# Usage:
#
# describe Post do
# it { should serialize(:data) } # serialize :data
# it { should serialize(:registers).as(Array) } # serialize :registers, Array
# it { should serialize(:options).as(Hash) } # serialize :options, Hash
# end
Test