This file contains hidden or 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 "rake" | |
| require "pathname" | |
| require "rexml/document" | |
| manifest = REXML::Document.new(File.read("AndroidManifest.xml")) | |
| PACKAGE = manifest.elements["/manifest/@package"].value | |
| NAME = manifest.elements["/manifest/application/activity/@android:name"].value |
This file contains hidden or 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
| sudo rm -rf /private/var/log/asl* |
This file contains hidden or 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
| <html> | |
| <head> | |
| <title>Test</title> | |
| <link rel="stylesheet" media="all" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/themes/start/jquery-ui.css"></link> | |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> | |
| <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js"></script> | |
| <script src="jquery.myplugin.js"></script> | |
| <script> | |
| $(document).ready(function(){ | |
| //call plugin |
This file contains hidden or 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
| <html> | |
| <head> | |
| <title>Test</title> | |
| <link rel="stylesheet" media="all" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/themes/start/jquery-ui.css"></link> | |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> | |
| <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js"></script> | |
| <script src="jquery.myplugin.js"></script> | |
| <script> | |
| $(document).ready(function(){ | |
| //call plugin |
This file contains hidden or 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
| encode = function(obj){ | |
| //simple partial JSON encoder implementation | |
| if(window.JSON && JSON.stringify) return JSON.stringify(obj); | |
| var enc = arguments.callee; //for purposes of recursion | |
| if(typeof obj == "boolean" || typeof obj == "number"){ | |
| return obj+'' //should work... | |
| }else if(typeof obj == "string"){ | |
| //a large portion of this is stolen from Douglas Crockford's json2.js | |
| return '"'+ |
This file contains hidden or 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
| TEX_FILES = FileList["*.tex", "figures/*", "*.bib", "*.cls"] | |
| MAIN = "thesis" # name of main file without .tex suffix | |
| MAIN_TEX = "#{MAIN}.tex" | |
| OUT_PDF = "#{MAIN}.pdf" | |
| file OUT_PDF => TEX_FILES do | |
| %x{pdflatex -interaction=batchmode #{MAIN_TEX} >/dev/null 2>&1} | |
| %x{makeindex #{MAIN} >/dev/null 2>&1} | |
| %x{bibtex #{MAIN} >/dev/null 2>&1} | |
| %x{pdflatex -interaction=batchmode #{MAIN_TEX} >/dev/null 2>&1} |
This file contains hidden or 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
| # Rakefile for building tex file | |
| require "rake/clean" | |
| BASE = "documentname" | |
| TYPE = ".tex" | |
| OUT = ".pdf" | |
| TEXFILE = FileList[BASE+TYPE] | |
| OUTFILE = FileList[BASE+OUT] | |
| BIBTEXCMD = "bibtex" |
This file contains hidden or 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
| # Problem: | |
| # | |
| # I have a number of items that need to be shipped. | |
| # Each item is less than one pound. | |
| # Each shipment can contain a maximum of one pound of items. | |
| # How can I efficiently pack the packages? | |
| class BoxContainer | |
| attr_reader :boxes |
This file contains hidden or 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
| <html> | |
| <head> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> | |
| <script src="http://yandex.st/raphael/1.5.2/raphael.min.js"></script> | |
| <script> | |
| /** | |
| * A Simple Vector Shape Drawing App with RaphaelJS and jQuery | |
| * copyright 2010 Kayla Rose Martin - Licensed under the MIT license | |
| * Inspired by http://stackoverflow.com/questions/3582344/draw-a-connection-line-in-raphaeljs | |
| **/ |
This file contains hidden or 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
| if `ant -version` !~ /version (\d+)\.(\d+)\.(\d+)/ || $1.to_i < 1 || ($1.to_i == 1 && $2.to_i < 8) | |
| puts "ANT version 1.8.0 or later required. Version found: #{$1}.#{$2}.#{$3}" | |
| exit 1 | |
| end | |
| require 'time' | |
| def manifest() @manifest ||= REXML::Document.new(File.read(MANIFEST_FILE)) end | |
| def package() manifest.root.attribute('package') end | |
| def build_project_name() @build_project_name ||= REXML::Document.new(File.read('build.xml')).elements['project'].attribute(:name).value end |