This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Would this be useful to Phoenix? | |
# | |
# In controllers, it'd be nice to be able to refer to status codes as atoms instead of integers. | |
# | |
defmodule Phoenix.Controller.StatusCodes do | |
@http_status_codes %{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# TypeBully forces functions to respect their typespecs by rewriting the function clauses to include proper guards. | |
# | |
# For example, the Wimp module below: cry/3 has typespecs, but no enforcing guards, normally, calling cry/3 would | |
# always match the first function clause, but TypeBully forces it to select the correct one based on its typespec. | |
# | |
# | |
# Without TypeBully: | |
# | |
# iex(1)> Wimp.cry("whaa") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var x = document.evaluate('//input[@value="Delete Request"]', document.documentElement, null, XPathResult.ANY_TYPE, null); | |
// gotta build an array of the elements, iterators throw exceptions if you modify the DOM from under them | |
var elements = []; | |
var thisNode = x.iterateNext(); | |
while (thisNode) { | |
elements.push(thisNode); | |
thisNode = x.iterateNext(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- 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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rdiff() { diff -u <(ssh $1 "cat $3") <(ssh $2 "cat $3") } |
NewerOlder