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
# encoding: utf-8 | |
def config | |
# in this Rakefile we can allow that | |
$config ||= Hash.new | |
end | |
# main TeX file without extension | |
config['main'] = 'YourAwesomeTex' |
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 "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 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 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 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 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 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 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 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 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 | |
**/ |