My Recent Pastes (634 and counting)

Pastes by Allan Odgaard (634 and counting)

Pages:

Below are the 15 most recent pasties by Allan Odgaard.

October 28, 2007
4:44PM EDT
by Allan Odgaard

# Terminal should set LC_CTYPE rather than LANG

By default Terminal sets LANG at startup (Preferences → Advanced).

The intent here I assume is to get the various shell commands to work with UTF-8, which is great, since file names (and thus `ls` output) are UTF-8 and so is keyboard input.

September 27, 2007
3:23PM EDT
by Allan Odgaard

#!/usr/bin/env ruby -wKU

EMAIL_PATTERN = /\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i

module HTML

September 21, 2007
6:43PM EDT
by Allan Odgaard

<source.ruby>      dir <keyword.operator.assignment.ruby>=</keyword.operator.assignment.ruby> <punctuation.section.array.ruby>[</punctuation.section.array.ruby>
        prefs<punctuation.section.array.ruby>[</punctuation.section.array.ruby><string.quoted.single.ruby><punctuation.definition.string.begin.ruby>'</punctuation.definition.string.begin.ruby>PBXProductDirectory<punctuation.definition.string.end.ruby>'</punctuation.definition.string.end.ruby></string.quoted.single.ruby><punctuation.section.array.ruby>]</punctuation.section.array.ruby><punctuation.separator.object.ruby>,</punctuation.separator.object.ruby>
        <punctuation.section.function.ruby>(</punctuation.section.function.ruby>prefs<punctuation.section.array.ruby>[</punctuation.section.array.ruby><string.quoted.single.ruby><punctuation.definition.string.begin.ruby>'</punctuation.definition.string.begin.ruby>PBXApplicationwideBuildSettings<punctuation.definition.string.end.ruby>'</punctuation.definition.string.end.ruby></string.quoted.single.ruby><punctuation.section.array.ruby>]</punctuation.section.array.ruby> <keyword.operator.logical.ruby>||</keyword.operator.logical.ruby> <punctuation.section.scope.ruby>{</punctuation.section.scope.ruby><meta.syntax.ruby.start-block> </meta.syntax.ruby.start-block><punctuation.section.scope.ruby>}</punctuation.section.scope.ruby><punctuation.section.function.ruby>)</punctuation.section.function.ruby><punctuation.section.array.ruby>[</punctuation.section.array.ruby><string.quoted.single.ruby><punctuation.definition.string.begin.ruby>'</punctuation.definition.string.begin.ruby>SYMROOT<punctuation.definition.string.end.ruby>'</punctuation.definition.string.end.ruby></string.quoted.single.ruby><punctuation.section.array.ruby>]</punctuation.section.array.ruby><punctuation.separator.object.ruby>,</punctuation.separator.object.ruby>
        default_dir
      <punctuation.section.array.ruby>]</punctuation.section.array.ruby><punctuation.separator.method.ruby>.</punctuation.separator.method.ruby>map <punctuation.section.scope.ruby>{</punctuation.section.scope.ruby><meta.syntax.ruby.start-block> </meta.syntax.ruby.start-block><punctuation.separator.variable.ruby>|</punctuation.separator.variable.ruby><variable.other.block.ruby>e</variable.other.block.ruby><punctuation.separator.variable.ruby>|</punctuation.separator.variable.ruby> e <keyword.operator.logical.ruby>&amp;&amp;</keyword.operator.logical.ruby> <support.class.ruby>File</support.class.ruby><punctuation.separator.method.ruby>.</punctuation.separator.method.ruby>expand_path<punctuation.section.function.ruby>(</punctuation.section.function.ruby>e<punctuation.section.function.ruby>)</punctuation.section.function.ruby> <punctuation.section.scope.ruby>}</punctuation.section.scope.ruby><punctuation.separator.method.ruby>.</punctuation.separator.method.ruby>find <punctuation.section.scope.ruby>{</punctuation.section.scope.ruby><meta.syntax.ruby.start-block> </meta.syntax.ruby.start-block><punctuation.separator.variable.ruby>|</punctuation.separator.variable.ruby><variable.other.block.ruby>path</variable.other.block.ruby><punctuation.separator.variable.ruby>|</punctuation.separator.variable.ruby> path <keyword.operator.logical.ruby>&amp;&amp;</keyword.operator.logical.ruby> <support.class.ruby>File</support.class.ruby><punctuation.separator.method.ruby>.</punctuation.separator.method.ruby>directory?<punctuation.section.function.ruby>(</punctuation.section.function.ruby>path<punctuation.section.function.ruby>)</punctuation.section.function.ruby> <punctuation.section.scope.ruby>}</punctuation.section.scope.ruby>

September 21, 2007
6:27PM EDT
by Allan Odgaard

        def Xcode.preferences
                global_path = "#{ENV['HOME']}/Library/Preferences/com.apple.Xcode.plist"
                open(global_path) { |io| OSX::PropertyList.load io } rescue { }
        end

September 21, 2007
6:27PM EDT
by Allan Odgaard

      default_dir = File.dirname(@project_path) + "/build"
      prefs = Xcode.preferences

      dir = [
        prefs['PBXProductDirectory'],

September 21, 2007
5:37PM EDT
by Allan Odgaard

      # default to global build results
      global_path = "#{ENV['HOME']}/Library/Preferences/com.apple.Xcode.plist"
      default_dir = File.dirname(@project_path) + "/build"
      
      dir = if File.exist?(global_path)

September 21, 2007
5:33PM EDT
by Allan Odgaard

      global_path = "#{ENV['HOME']}/Library/Preferences/com.apple.Xcode.plist"
      default_dir = File.dirname(@project_path) + "/build"
      
      dir = if File.exist?(global_path)
        prefs = OSX::PropertyList.load(File.new(global_path))

September 03, 2007
8:08PM EDT
by Allan Odgaard

 1. This is a list item

    > With some paragraphs.
    > Let's [test][].
    > 

September 03, 2007
8:08PM EDT
by Allan Odgaard

 1. This is a list item

    With some paragraphs.
    Let's [test][].
    

September 03, 2007
5:42PM EDT
by Allan Odgaard

#!/usr/bin/env ruby -wKU

require ENV['TM_SUPPORT_PATH'] + '/lib/ui.rb'
require ENV['TM_SUPPORT_PATH'] + '/lib/escape.rb'

September 01, 2007
9:44PM EDT
by Allan Odgaard

            stdin, stdout, stderr = Open3.popen3(cmd)
            leftover = { }
            TextMate::IO.exhaust(:output => stdout, :error => stderr) do |str, type|
              # we only want to call ‘block’ with full lines so we cut any trailing bytes that are not newline terminated and save for next time we call block
              if str =~ /\A(.*\n|)([^\n]*)\z/m

August 31, 2007
3:34PM EDT
by Allan Odgaard

% svn merge -r8006:7999 .
D    IncrementalPopUpMenu.nib/info.nib
D    IncrementalPopUpMenu.nib/keyedobjects.nib
D    IncrementalPopUpMenu.nib/classes.nib
D    IncrementalPopUpMenu.nib

August 29, 2007
6:43PM EDT
by Allan Odgaard

[12:40am] allan: pasting it here when the bundle maintainer is here should be fine I think
[12:41am] allan: but given how it basically removes support for rhtml, the patch might be a little controversial at present time
[12:41am] allan: I think only rails edge has this change
[12:41am] • allan pokes canadaduane
[12:41am] allan: you got input here?

August 29, 2007
4:11PM EDT
by Allan Odgaard

(
    {
        children = ({name = childname; type = childtype; value = childvalue; children = (); }); 
        name = thename; 
        type = thetype; 

August 02, 2007
9:29PM EDT
by Allan Odgaard

data = {
        :account => 'duff_mysql',
        :server => '127.0.0.1',
        :protocol => 'mysq',
        :port => 0,

Next page

Previous page