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
#model | |
class Comment < ActiveRecord::Base | |
belongs_to :podcast | |
validates_presence_of :content | |
validates_presence_of :author_name | |
validates_presence_of :podcast_id | |
validates_length_of :author_name, :within => 2..40 | |
validates_length_of :author_url, :within => 5..200, :allow_blank => true | |
validates_format_of :author_url, :with => /^[^\"\'\\]*$/, | |
:message => "can't include backslash or bracket" |
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 CommentsController < ApplicationController | |
def create | |
@podcast = Podcast.find params[:comment][:podcast_id] | |
params[:comment][:podcast_id] = nil | |
@comment = @podcast.comments.new params[:comment] | |
if @comment.save | |
flash[:notice] = "Comment writen" | |
redirect_to @podcast | |
else | |
@podcast = Podcast.find params[:comment][:podcast_id] |
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
<? | |
#controller | |
$bdks = $this->db->select('distinct year as name')->where('site', $_REQUEST['siteid'])->get('pers_to_date')->result(); | |
$this->my_view->view('admin/mailer/filter', array( | |
'users' => $users, | |
'total_rows' => $users_num, | |
'branches' => $this->db->get('branch')->result(), // бля, почему не branches ? |
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
$$('.to_frame').each(function (el) { | |
var html = el.get('html'); | |
var myIFrame = new IFrame({ | |
src: '', | |
styles: { | |
width: el.getStyle('width'), | |
height: el.getStyle('height').toInt() + 3, | |
border: 0, | |
padding: 0 | |
} |
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 file_tree files, sub = nil, &proc | |
res = "<ul #{'class="subdir"' if sub }>" | |
files.each do |file, value| | |
subdir = (value.class == Hash) ? file_tree(value, 1) { |a, b| proc.call a, b } : nil | |
res += proc.call file, subdir | |
end | |
res + '</ul>' | |
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
name: "QuickBox" | |
assets: | |
css: | |
- "css/quickbox.css" | |
js: | |
quickbox.js: general | |
a.js: "simple" | |
b.js: "simple, advaced" | |
c.js: "specific, advanced" |
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
root@server-2:~/vertexdb# ./bin/compile2 | |
source/basekit/source/UArray_character.c: In function ‘UArray_isalpha’: | |
source/basekit/source/UArray_character.c:16: warning: overflow in implicit constant conversion | |
source/basekit/source/UArray_character.c:16: warning: overflow in implicit constant conversion | |
source/basekit/source/UArray_character.c: In function ‘UArray_isdigit’: | |
source/basekit/source/UArray_character.c:18: warning: overflow in implicit constant conversion | |
source/basekit/source/UArray_character.c:18: warning: overflow in implicit constant conversion | |
source/basekit/source/UArray_character.c: In function ‘UArray_isgraph’: | |
source/basekit/source/UArray_character.c:19: warning: overflow in implicit constant conversion | |
source/basekit/source/UArray_character.c:19: warning: overflow in implicit constant conversion |
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
/* | |
Script: mJSON.js | |
JSON encoder and decoder. | |
License: | |
MIT-style license. | |
See Also: | |
<http://www.json.org/> |
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 | |
# send request on website every 10 seconds | |
# checks request time and show growl notify and tell you by `say` if response time is more then 2 seconds | |
require 'rubygems' | |
require 'httparty' | |
require 'growl' |
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
... | |
# including fix manualy, becouse loading lib/**/*.rb happends in Padrino.load! | |
require "lib/reloader_fix" | |
Padrino::Reloader::Stat.skip_folders = %W{photos utilites vertex-lib importers} | |
Padrino.load! |
OlderNewer