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
######################### | |
# .gitignore file for Xcode4 and Xcode5 Source projects | |
# | |
# Apple bugs, waiting for Apple to fix/respond: | |
# | |
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation? | |
# | |
# Version 2.3 | |
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects | |
# |
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
define(['../Excel/Workbook', '../Excel/Table'], function (Workbook, Table) { | |
var Template = function (worksheetConstructorSettings) { | |
this.workbook = new Workbook(); | |
this.stylesheet = this.workbook.getStyleSheet(); | |
this.columns = {}; | |
this.predefinedStyles = { | |
}; |
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
In Ruby 1.9.2 to escape XML special characters in Strings, use the 'encode' method. | |
Example, if you have: | |
my_string = 'this is "my" complicated <String>' | |
For XML attributes use: | |
"<node attr=#{my_string.encode(:xml => :attr)} />" | |
Generates: |
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/ruby -w | |
require "rubygems" | |
require 'RMagick' | |
Text = ':)' | |
granite = Magick::ImageList.new('plasma:fractal') {self.size = "128x128"} | |
canvas = Magick::ImageList.new | |
canvas.new_image(128, 128, Magick::TextureFill.new(granite)) | |
#canvas.rotate(45) |
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
namespace Something.utils | |
{ | |
public class XElementDiff | |
{ | |
public static void AssertEqual(XElement actual, XElement source) | |
{ | |
ValuesAreEqual(actual, source); | |
TagsAreEqual(actual, source); | |
var actualElements = actual.Elements(); | |
var sourceElements = source.Elements(); |
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
@ECHO OFF | |
ruby convert_greek_to_utf8.rb "%~dpn0" %* | |
pause |
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
let r = [0;1;2;3] | |
let stitch s= | |
let head = s |> Seq.head | |
let tail = s |> Seq.skip 1 | |
tail |> Seq.scan (fun state elem-> (snd state, elem)) (head, head) | |
|> Seq.skip 1 | |
|> Seq.toList | |
open System.Linq |
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 "rubygems" | |
require "nokogiri" | |
def getfiles(dir) | |
return Dir.new(dir).entries.select {|file| file =~ /[^.]*.html/ } | |
end | |
def replaceChars(str) | |
return str.gsub('å','å').gsub('ä','ä').gsub('ö','ö') \ | |
.gsub('Å','Å').gsub('Ä','Ä').gsub('Ö','ö') \ |
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
desc "Check the JavaScript source with JSLint - exit with status 1 if any of the files fail." | |
task :jslint do | |
failed_files = [] | |
classpath = File.join(RAILS_ROOT, "vendor", "rhino.jar") | |
jslint_path = File.join(RAILS_ROOT, "vendor", "jslint.js") | |
Dir['public/**/*.js'].reject{|path| path =~ /public\/ext\//}.each do |fname| | |
cmd = "java -cp #{classpath} org.mozilla.javascript.tools.shell.Main #{jslint_path} #{fname}" | |
results = %x{#{cmd}} | |
unless results =~ /^jslint: No problems found in/ | |
puts "#{fname}:" |
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
App.Router = Backbone.Router.extend({ | |
routes : { | |
"" : "home" | |
,"/" : "home" | |
,"!" : "home" | |
,"!/" : "home" | |
,"!/:username" : "show_user" | |
,":username" : "show_user" | |
,":username/" : "show_user" |