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
| #include "screencasts.h" | |
| /* Globals */ | |
| double dim=2; /* dimension of orthogonal box */ | |
| char *windowName = "OpenGL screenscasts 5: Using GLUT for OpenGL interaction"; | |
| int windowWidth=500; | |
| int windowHeight=450; | |
| /* global state */ | |
| char *mouseBtnPressed = ""; |
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
| #include "screencasts.h" | |
| /* Globals */ | |
| double dim=2; /* dimension of orthogonal box */ | |
| char *windowName = "OpenGL screenscasts 4: Drawing triangles, quads, and polygons"; | |
| int windowWidth=500; | |
| int windowHeight=500; | |
| /* | |
| * Display the scene |
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
| development: &global_settings | |
| database: textual_development | |
| host: 127.0.0.1 | |
| port: 27017 | |
| test: | |
| database: textual_test | |
| <<: *global_settings | |
| production: |
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
| Warden::Manager.serialize_into_session{|user| user.id } | |
| Warden::Manager.serialize_from_session{|id| User.get(id) } | |
| Warden::Manager.before_failure do |env,opts| | |
| # Sinatra is very sensitive to the request method | |
| # since authentication could fail on any type of method, we need | |
| # to set it for the failure app so it is routed to the correct block | |
| env['REQUEST_METHOD'] = "POST" | |
| end | |
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
| #!/bin/bash | |
| # Unattended REE/Passenger installation | |
| # Source: http://weblog.brightlight-ict.nl/2008/12/unattended-passenger-ruby-enterprise-installation-on-ubuntu-8/ | |
| # 15/03/09 Updated to use latest r.e.e. and passenger 2.1 and rewrote bits thanks to the comments left on my blog. Thanks guys | |
| if [ "$(whoami)" != "root" ]; then | |
| echo "You need to be root to run this!" | |
| exit 2 | |
| fi | |
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
| class Announcement < ActiveRecord::Base | |
| named_scope :active, lambda { { :conditions => ['starts_at <= ? AND ends_at >= ?', Time.now.utc, Time.now.utc] } } | |
| named_scope :since, lambda { |hide_time| { :conditions => (hide_time ? ['updated_at > ? OR starts_at > ?', hide_time.utc, hide_time.utc] : nil) } } | |
| def self.current_announcements(hide_time) | |
| active.since(hide_time) | |
| end | |
| end |
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
| var cs_pa = ["colors","palettes"] | |
| var noun_type_cs_pa = new CmdUtils.NounType( "colors or palettes", cs_pa ); | |
| CmdUtils.CreateCommand({ | |
| name: "color", | |
| description: "Find colors and palettes on Colour Lover. Search by colors or search by colors or hex for palettes.", | |
| help: "Try issuing "color blue" or "color #005F6B" by palettes", | |
| icon: "http://colourlovers.com.s3.amazonaws.com/favicon.ico", | |
| takes: {"color or hex": noun_arb_text}, | |
| modifiers: { "by": noun_type_cs_pa}, |
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
| CmdUtils.CreateCommand( | |
| { | |
| name: "ruby", | |
| takes: {"function": noun_arb_text}, | |
| icon: "http://ruby-doc.org/favicon.ico", | |
| homepage: "http://jackndempsey.blogspot.com", | |
| author: {name: "Jack Dempsey", email: "jack.dempsey@gmail.com"}, | |
| license: "MPL,GPL", | |
| description: "Search ruby functions documentation", | |
| help: "Select a ruby function", |
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
| CmdUtils.CreateCommand( | |
| { | |
| name: "rspec", | |
| takes: {"function": noun_arb_text}, | |
| icon: "http://ruby-doc.org/favicon.ico", | |
| homepage: "http://davidwparker.com", | |
| author: {name: "Jack Dempsey, fork by David Parker", email: "davidwparker@gmail.com"}, | |
| license: "MPL,GPL", | |
| description: "Search rspec functions documentation", | |
| help: "Select a rspec function", |