Skip to content

Instantly share code, notes, and snippets.

class ApplicationController < ActionController::Base
def current_user
User.find(session[:user_id])
end
end
interface="sis0"
primary_ip="94.23.4.157"
secondary_ip="87.98.236.112"
machine_ips="{" $primary_ip $secondary_ip "}"
table <bad_hosts>
block in log all
@current_user ||= User.find(session[:user_id])
<!DOCTYPE html>
<html>
<head>
<meta name="author" content="Paweł Lenart" /><meta name="keywords" content="HTML, CSS, JavaScript, PHP, MySQL, PostgreSQL, Ruby, Rails" />
<title class="exceptional">Programmer</title>
</head>
<body>
Here's my <a href="mailto:pawel@lenart.pl">email</a>.
You can also call me on <span class="mobile">+48 664 134 697</a>.
</body>
@pawellenart
pawellenart / gist:921418
Created April 15, 2011 08:51
solarized
pawel@plenart-pc:~$ vim -v
Error detected while processing /home/pawel/.vimrc:
line 1:
E319: Sorry, the command is not available in this version: syntax enable
Error detected while processing /home/pawel/.vim/colors/solarized.vim:
line 286:
E319: Sorry, the command is not available in this version: let colors_name = "solarized"
line 395:
E319: Sorry, the command is not available in this version: let s:none = "NONE"
line 396:
class CommentsController < ApplicationController
before_filter :load_project
before_filter :assign_user
def create
@comment = @project.comments.new(params[:comment])
if @comment.save
redirect_to @project, :notice => 'Comment has been added'
else
redirect_to @project, :alert => 'Unable to add a comment'
function createUploader(){
var uploader = new qq.FileUploader({
element: document.getElementById('file-uploader'),
action: '../include/upload/upload.php',
debug: false,
onSubmit: function() {
$("#su_name, #su_company, #su_project, #su_email").css('border', '0');
if ($("#su_name").val() == "" ||
<?php
/**
* Eurotax Valuation Webservice Handler
*
* This class allows connecting to Eurotax Webservice, fetching dictionary data
* and request vehicle valuation.
*
* Usage example:
* <code>
* <?php
<?php
require_once SITE_PATH . 'inc/lib/DatabaseDriver.class.php';
abstract class BaseModel extends DatabaseDriver implements ArrayAccess {
protected $tablename = null;
private $schema;
private $attributes = array();
private $is_new = true;
<?php
require_once SITE_PATH . 'inc/lib/DatabaseDriver.class.php';
abstract class BaseModel extends DatabaseDriver implements ArrayAccess, Iterator {
protected $tablename = null;
private $schema;
protected $attributes = array();
private $is_new = true;