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 Codepoints do | |
defstruct str: "" | |
def new(str) when is_list(str) do | |
new(to_string(str)) | |
end | |
def new(str) when is_binary(str) do | |
%__MODULE__{str: str} | |
end |
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 Parallel do | |
def run(funs, max) do | |
tasks = for fun <- funs, do: {make_ref, fun} | |
results = do_run(tasks, max, 0, %{}) | |
for {ref, _} <- tasks, do: results[ref] | |
end | |
defp do_run([], _max, 0, results) do | |
results | |
end |
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 bash | |
set -euo pipefail | |
IFS=$'\n\t' |
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
lines = `tput lines`.to_i | |
cols = `tput cols`.to_i | |
# hide cursor | |
print "\e[?25l" | |
# clear screen | |
print "\e[2J" | |
at_exit do |
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
# MathN using Ruby 2.0 refinements instead of plain monkey patches | |
# Patrick OSCITY 2013 | |
# | |
# Based on original mathn implementation by Keiju ISHITSUKA from Ruby 1.8.7-p72 | |
# http://www.opensource.apple.com/source/ruby/ruby-75/ruby/lib/mathn.rb | |
# | |
# Distributes under the same terms as Ruby. | |
require "complex" | |
require "rational" |
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
require 'formula' | |
class Zsh < Formula | |
homepage 'http://www.zsh.org/' | |
url 'http://www.zsh.org/pub/zsh-5.0.2.tar.bz2' | |
mirror 'http://downloads.sourceforge.net/project/zsh/zsh/5.0.2/zsh-5.0.2.tar.bz2' | |
sha1 '9f55ecaaae7cdc1495f91237ba2ec087777a4ad9' | |
depends_on 'gdbm' | |
depends_on 'pcre' |
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/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c | |
index 17b78ce..f136178 100644 | |
--- a/Src/Zle/zle_refresh.c | |
+++ b/Src/Zle/zle_refresh.c | |
@@ -1576,7 +1576,7 @@ zrefresh(void) | |
else | |
put_rpmpt = rprompth == 1 && rpromptbuf[0] && | |
!strchr(rpromptbuf, '\t') && | |
- (int)ZR_strlen(nbuf[0]) + rpromptw < winw - 1; | |
+ (int)ZR_strlen(nbuf[0]) + rpromptw < winw; |
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
puts a=[<<-X*2,?X] | |
puts a=[<<-X*2,?X] | |
X |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<definitions xmlns:typens="urn:Magento" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" | |
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" | |
name="Magento" targetNamespace="urn:Magento"> | |
<types> | |
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:Magento"> | |
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/" /> | |
<complexType name="FixedArray"> | |
<complexContent> | |
<restriction base="soapenc:Array"> |
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
<wsdl:definitions xmlns:ns2="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="Magento" targetNamespace="urn:Magento"> | |
<wsdl:types> | |
<xs:schema targetNamespace="urn:Magento"> | |
<xs:attribute name="root"> | |
<xs:annotation> | |
<xs:documentation> | |
'root' can be used to distinguish serialization roots from other | |
elements that are present in a serialization but are not roots of | |
a serialized value graph | |
</xs:documentation> |