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
// | |
// NSArray-Blocks.h | |
// Handy codebits | |
// | |
// If you want to keep block definitions terse, simple and dynamic, have no | |
// problems with the incompatible block pointer types and you don't mind | |
// compiler warnings about sending a message without matching signature, | |
// DO NOT IMPORT THIS FILE, seriously. | |
// | |
// Created by Sijawusz Pur Rahnama on 15/11/09. |
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
<?php | |
/** | |
* | |
* @mainpage | |
* | |
* This library is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Lesser General Public | |
* License as published by the Free Software Foundation; either | |
* version 2.1 of the License, or (at your option) any later version. |
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
<?xml version="1.0" encoding="utf-8"?> | |
<xsl:stylesheet | |
version="1.0" | |
xmlns:msxsl="urn:schemas-microsoft-com:xslt" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output method="html"/> | |
<xsl:template match="*"/> | |
<xsl:template match="svn"> | |
<html> |
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
// | |
// Benchmark.h | |
// Opskrifter | |
// | |
// Created by Sijawusz Pur Rahnama on 03/02/09. | |
// Copyleft 2009. Some rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
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
merge = (target, objects...) -> | |
deep = yes | |
if typeof target is 'boolean' | |
[deep, target] = [target, objects.shift()] | |
if not objects.length | |
[target, objects] = [this, [target]] | |
isExtendable = (object) -> | |
typeof object is 'object' and object isnt null or |
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
# Execute function immediately | |
typeOf = do -> | |
classToType = {} | |
for name in 'Boolean Number String Function Array Date RegExp Undefined Null'.split ' ' | |
classToType["[object #{name}]"] = name.toLowerCase() | |
# Return a function | |
(obj) -> | |
strType = Object::toString.call obj | |
classToType[strType] or 'object' |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: unicorn | |
# Required-Start: $local_fs $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: unicorn initscript | |
# Description: Unicorn is an HTTP server for Rack application | |
### END INIT INFO |
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 'active_record/fixtures' | |
namespace :db do | |
desc 'Seed the database with once/ and always/ fixtures.' | |
task :seed => :environment do | |
load_fixtures 'seed/once' | |
load_fixtures 'seed/always', :always | |
end | |
desc 'Seed the database with develop/ fixtures.' |
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
moduleKeywords = ['extended', 'included'] | |
class Module | |
@extend: (obj) -> | |
for key, value of obj when key not in moduleKeywords | |
@[key] = value | |
obj.extended?.apply(@) | |
this |
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
class DimensionsValidator < ActiveModel::EachValidator | |
def validate_each(record, attribute, value) | |
temp_file = value.queued_for_write[:original] | |
return unless temp_file.present? | |
return unless geo = Paperclip::Geometry.from_file(temp_file) | |
options.slice(:width, :height).each_pair do |key, expectation| | |
next unless dimension = geo.send(key) | |
case expectation |
OlderNewer