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 'prawn' | |
Prawn::Document.generate('crop-marks.pdf') do | |
spacing = 12 | |
margin = 100 | |
canvas do | |
# topleft corner | |
stroke_line [bounds.left + spacing, bounds.top - margin], | |
[bounds.left + margin - spacing, bounds.top - margin] |
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
Module Prawn | |
Class Document | |
def draw_crop_marks(spacing, margin, lineweight) | |
#crop mark line thickness | |
line_width(lineweight) | |
#spacing = 2.125 | |
#margin = 9 | |
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
import java.awt.BorderLayout; | |
import java.awt.GraphicsConfigTemplate; | |
import java.awt.GraphicsDevice; | |
import java.awt.GraphicsEnvironment; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import java.awt.event.WindowAdapter; | |
import java.awt.event.WindowEvent; | |
import java.awt.image.BufferedImage; | |
import java.awt.image.RenderedImage; |
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
import java.awt.event.ActionListener; | |
import java.awt.event.ActionEvent; | |
import java.awt.Component; | |
import java.awt.Container; | |
import java.awt.Dimension; | |
import java.awt.Insets; | |
import javax.swing.Box; | |
import javax.swing.BoxLayout; | |
import javax.swing.DefaultListModel; | |
import javax.swing.JButton; |
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
- (BOOL)insertNewObject | |
{ | |
// Create a new instance of the entity managed by the fetched results controller. | |
NSManagedObjectContext *context = [fetchedResultsController managedObjectContext]; | |
NSEntityDescription *entity = [[fetchedResultsController fetchRequest] entity]; | |
NSManagedObject *newManagedObject = [NSEntityDescription insertNewObjectForEntityForName:[entity name] inManagedObjectContext:context]; | |
// If appropriate, configure the new managed object. | |
NSLog(@"%@", currentID); | |
[newManagedObject setValue:[currentID stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] forKey:@"id"]; |
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
git clone git://github.com/remear/xcodegitconfig.git | |
cd xcodegitconfig | |
sudo ruby InstallXcodeProjectGitSettings.rb |
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
source 'http://rubygems.org' | |
gem 'capistrano' | |
gem 'mysql' | |
gem 'rails', '3.0.0.beta4' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
# To use debugger | |
# gem 'ruby-debug' |
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
def self.find_by_username_or_email(login) | |
find_by_email(login) || find_by_login(login) | |
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
server { | |
server_name myhost.com; | |
listen 80; | |
error_log /var/log/myhost.com-error.log; | |
access_log /var/log/myhost.com-access.log; | |
location ~ \.php$ { | |
include /etc/nginx/fastcgi_params; | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME /WebServer/Documents/myhost$fastcgi_script_name; |
OlderNewer