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 Reservation::Group < ActiveRecord::Base | |
| set_table_name "reservation_groups" | |
| has_many :reservations, :foreign_key => "group_id" | |
| has_many :reservation_views, :order => "start DESC, duration ASC", :foreign_key => "group_id", :class_name => "Reservation::View" | |
| attr_accessor :tmpid | |
| validates_presence_of :name | |
| default_scope :order => "LOWER(name) ASC" | |
| 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
| def quoted_date(value) | |
| if value.acts_like?(:time) && value.respond_to?(:usec) | |
| begin | |
| "#{value.getutc.to_s(:db)}.#{sprintf("%06d", value.usec)} #{value.formatted_offset}" | |
| rescue | |
| "#{super}.#{sprintf("%06d", value.usec)}" | |
| end | |
| else | |
| super |
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
| (function(){ | |
| var Format = { | |
| defaults: { | |
| precision: 3, | |
| delimiter: ',', | |
| separator: ' ', | |
| fixed_length: false, | |
| fixed_delimiter: " ", | |
| precision_unit: null, | |
| currency: "Kč" |
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
| #/usr/bin/env ruby | |
| framework "AppKit" | |
| app = NSApplication.sharedApplication | |
| class TwisterDelegate | |
| SIDES = %w{left right} | |
| BODY_PARTS = %w{foot hand} | |
| COLORS = %w{red green blue yellow} | |
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
| Private Sub GeneratePasswords(sheetName As String, count As Integer) | |
| For i = 1 To count | |
| Sheets(sheetName).Cells(i, 2).Value = GeneratePassword | |
| Next i | |
| End Sub | |
| Public Function GeneratePassword() As String | |
| Dim lowercase, decimals, special As String |
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
| Imports Calculator.CalculatorModel | |
| Public Class Calculator | |
| Dim WithEvents model As CalculatorModel | |
| Private Sub MemoryController(ByVal sender As System.Windows.Forms.Button, ByVal e As System.EventArgs) Handles MemCBtn.Click, MemMBtn.Click, MemPBtn.Click, MemRBtn.Click, MemSBtn.Click | |
| Try |
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
| #!/usr/bin/env macruby | |
| # encoding: utf-8 | |
| CALENDARS = ['Michal Cichra', 'Calendar'] # Set names of calendars to show | |
| before = 3 # days to show before today | |
| after = 10 # days to show after today | |
| today = 'dnes' |
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 'factory_girl/step_definitions' | |
| def FactorySingleton(*args) | |
| FactorySingleton.find_or_self *args | |
| end | |
| module FactorySingleton | |
| def find_or_self object, attribute = nil | |
| # FIXME: instead of this probably could check validation reflection for unique attributes | |
| attribute ||= case object |
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
| read -s -r -d '' SCRIPT <<"EOF" | |
| framework 'ScriptingBridge' | |
| rating = ARGV.pop | |
| itunes = SBApplication.applicationWithBundleIdentifier("com.apple.itunes") | |
| track = itunes.currentTrack | |
| track.rating = rating.to_f*20 | |
| puts "#{track.artist} - #{track.name} rated #{rating} stars" | |
| EOF |
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
| request = require('request') | |
| money = require('money') | |
| fs = require('fs') | |
| arguments = process.argv.splice(2) | |
| amount = arguments.shift() | |
| try | |
| loop | |
| base = arguments.shift() |
OlderNewer