Skip to content

Instantly share code, notes, and snippets.

Michael Shapiro koudelka

Block or report user

Report or block koudelka

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 keybase.md

Keybase proof

I hereby claim:

  • I am koudelka on github.
  • I am koudelka (https://keybase.io/koudelka) on keybase.
  • I have a public key whose fingerprint is 7E62 AE05 4D2C 2331 76DF F5AC 81D1 A93F 604E 49B3

To claim this, I am signing this object:

@koudelka
koudelka / gist:383bb1362432ed320c9b
Created May 21, 2014
Compare two files on remote hosts.
View gist:383bb1362432ed320c9b
rdiff() { diff -u <(ssh $1 "cat $3") <(ssh $2 "cat $3") }
@koudelka
koudelka / compare_dpkg.rb
Created May 21, 2014
Quick n' dirty utility to compare the state of packages on two ubuntu/debian machines.
View compare_dpkg.rb
#!/usr/bin/env ruby
#
# This utility compares the state of `dpkg -l` on two given boxes
#
puts "Usage: #{$PROGRAM_NAME} hostname other_hostname" and exit unless ARGV.length == 2
PACKAGES = {}
@koudelka
koudelka / compare_sysctl.rb
Last active Aug 29, 2015
Quick n' dirty utility to compare sysctls between two machines.
View compare_sysctl.rb
#!/usr/bin/env ruby
#
# This utility compares `sysctl -a` on two given boxes
#
puts "Usage: #{$PROGRAM_NAME} hostname other_hostname" and exit unless ARGV.length == 2
SYSCTLS = {}
@koudelka
koudelka / silent_shell.ex
Created Jul 2, 2014
a silent Mix.Shell.Process
View silent_shell.ex
defmodule Mix.Shell.Process.Quiet do
@moduledoc """
This is a Mix shell, identical to Mix.Shell.Process, except that console output is silenced.
"""
@behaviour Mix.Shell
defdelegate [flush(callback), cmd(command), prompt(message), yes?(message)], to: Mix.Shell.Process
def print_app, do: nil
View gist:376199
class A
include Mongoid::Document
field :some_field
validates_presence_of :some_field
before_validate :set_some_field
after_validate Proc.new { p "after_validation" }
View MacVim 1.9.1 patch.diff
diff --git a/src/configure.in b/src/configure.in
index 85df7da..c812062 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -996,72 +996,75 @@ if test "$enable_rubyinterp" = "yes"; then
AC_ARG_WITH(ruby-command, [ --with-ruby-command=RUBY name of the Ruby command (default: ruby)],
RUBY_CMD="$withval"; AC_MSG_RESULT($RUBY_CMD),
RUBY_CMD="ruby"; AC_MSG_RESULT(defaulting to $RUBY_CMD))
+ if test "X$vi_cv_path_ruby" = "X"; then
+ vi_cv_path_ruby=$withval
View MacRubyCustomRubyCommand.diff
--- a/src/configure.in
+++ b/src/configure.in
@@ -993,11 +993,17 @@ AC_ARG_ENABLE(rubyinterp,
AC_MSG_RESULT($enable_rubyinterp)
if test "$enable_rubyinterp" = "yes"; then
AC_MSG_CHECKING(--with-ruby-command argument)
+ dnl If a ruby command was provided, set RUBY_CMD to the name of the binary and RUBY_PATH to its directory
AC_ARG_WITH(ruby-command, [ --with-ruby-command=RUBY name of the Ruby command (default: ruby)],
- RUBY_CMD="$withval"; AC_MSG_RESULT($RUBY_CMD),
- RUBY_CMD="ruby"; AC_MSG_RESULT(defaulting to $RUBY_CMD))
@koudelka
koudelka / patch-src__retr.c.diff
Created Feb 4, 2012
Patches wget to make the --convert-links option also rewrite the provided --input-file
View patch-src__retr.c.diff
--- retr.c.orig 2011-08-30 08:47:33.000000000 -0500
+++ retr.c 2012-02-04 13:01:29.000000000 -0600
@@ -944,6 +944,13 @@
set_uri_encoding (iri, opt.locale, true);
set_content_encoding (iri, opt.locale);
+ int input_url_len = strlen(opt.base_href) + strlen(file) + 1;
+ char *input_url = (char *)calloc(input_url_len, sizeof(char));
+ strcat(input_url, opt.base_href);
+ strcat(input_url, file);
@koudelka
koudelka / lookup.ex
Created Oct 2, 2015
Elixir Set Lookup
View lookup.ex
defmodule Lookup do
@wordfile "words.txt"
@external_resource @wordfile
@times 1_000_000
@words @wordfile |> File.stream! |> Enum.map(&String.strip/1)
@hash_set Enum.into(@words, HashSet.new)
@map_set Enum.into(@words, MapSet.new)
You can’t perform that action at this time.