Skip to content

Instantly share code, notes, and snippets.

@jblac
jblac / vhost
Created February 24, 2013 23:55
<VirtualHost *:80>
ServerName mysite.dev
ServerAlias www.mysite.dev
DocumentRoot /var/www/mysite.com/htdocs
<Directory /var/www/mysite.com/htdocs/>
Allow from all
</Directory>
RailsBaseURI /
RailsBaseURI /adm
<Directory /var/www/mysite.com/htdocs/www/>
function getNotificationsCount() {
$.ajax({
url: '/notifications/count',
type:'GET',
success: function(response) {
if (response < 1) {
$('.nCount').hide();
} else {
$('.nCount').text(response).show();
}
public function getCountAction() {
$user = $this->getUser();
$entities = $em->getRepository('EcsCrmBundle:Notifications')->findBy(array('sentTo'=>$user->getId(), 'dateAckknowledged' => 'NULL'));
$count = sizeof($entities);
}
@jblac
jblac / company.rb
Last active December 13, 2015 22:08
user.company fails to load anything...
class Company < ActiveRecord::Base
attr_accessible :address, :city, :contact_email, :contact_name, :fax_number, :name, :phone_number, :state, :zip
has_many :users
end
class User < ActiveRecord::Base
attr_accessible :company_id, :email, :enabled, :first_name, :last_name, :password, :username
belongs_to :company
end
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
@jblac
jblac / script.js
Last active December 13, 2015 20:18
//= require jquery
//= require jquery-ui
//= require functions
//= require plugins
//= require elfinder
//= require datatables
//= require wl_Date
//= require wl_Time
//= require wl_Widget
//= require wl_Multiselect
function clear_cache() {
$this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate, no-transform, max-age=0, post-check=0, pre-check=0");
$this->output->set_header("Pragma: no-cache");
}
a {
color: #3f3f3f;
&:hover, :visited, :link {
@extend a;
}
}
#logo {
height: 24px;
padding: 18px 0 18px 15px;
width: 224px;
border: 0;
-webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px;
background:url(../images/logo.png) left center no-repeat;
text-decoration: none;
text-indent: -99999px;
a {}
<?php
use codeigniter\core\common;
use codeigniter\core\benchmark;
use codeigniter\core\hooks;
use codeigniter\core\config;
use codeigniter\core\utf8;
use codeigniter\core\uri;
use codeigniter\core\router;
use codeigniter\core\output;