Skip to content

Instantly share code, notes, and snippets.

View tayfunoziserikan's full-sized avatar
💭
Simple is perfect

Tayfun (Öziş) Erikan tayfunoziserikan

💭
Simple is perfect
View GitHub Profile
@tayfunoziserikan
tayfunoziserikan / gist:1545938
Created January 1, 2012 01:48
Kebab bootstrap code review version
/* -----------------------------------------------------------------------------
Kebab Project 2.x (Kebab Revolution) - Web OS Client Platform for Ext JS 4.x
http://kebab-project.com
Copyright (c) 2011-2012 lab2023 - internet technologies TURKEY Inc.
http://www.lab2023.com
----------------------------------------------------------------------------- */
/**
* Prepare environment, enable loader an boot kebab automatically
*
@tayfunoziserikan
tayfunoziserikan / gist:1554368
Created January 3, 2012 10:21
Server-ror-client-html-files
<!-- login.html.erb -->
<script type="text/javascript">Kebab.boot('Kebab.login.Application', 'http://static.kebab.local', ''); </script>
<!-- desktop.html.erb -->
<script type="text/javascript">Kebab.boot('Kebab.desktop.Application', 'http://static.kebab.local', '');</script>
$searchQuery = Doctrine_Core::getTable('Model_Entity_City')
->search($this->_request->query);
$searchIds = array();
foreach ($searchQuery as $result) {
$searchIds[] = $result['id'];
}
// DQL
$query = Doctrine_Query::create()
@tayfunoziserikan
tayfunoziserikan / gist:1694212
Created January 28, 2012 12:57
Ext JS 4 XTemplate Loop Breaking
new Ext.XTemplate( // Kiosk modu
'<ul id="finished-list">',
'<tpl for=".">',
'<tpl if="xindex == 1">',
'<li><span class="info"></span><strong class="important">{description}</strong> başvurmanızı öneririz.</span></li>',
'</tpl>',
'</tpl>',
'</ul>'
) :
@tayfunoziserikan
tayfunoziserikan / gist:1748569
Created February 6, 2012 00:30
ext js 4 dataview grouping
Ext.create('Ext.XTemplate',
'<h1>Active Users</h1>',
'<tpl for=".">',
'<tpl if="active == true">',
'<div class="users">',
'<p>{name}</p>',
'</div>',
'</tpl>',
'</tpl>',
'<h1>Deactive Users</h1>',
@tayfunoziserikan
tayfunoziserikan / gist:2290636
Created April 3, 2012 09:24
Ext JS 3 GridPanel GridView getRowClass kullanım örneği
// this == GridPanel
// Bu alandan gridin view sınıfına ulaşıp
// getRowClass methodunu overwrite ediyoruz.
// Method her calıstıgında record ve index parametreleri geçilir.
// Burada bir css sınıfı donduruyorusnuz ve grid o sınıfı row'larına ekliyor.
// O sınıfta da ıstedıgıniz renklendirmeler yapılır
this.getView().getRowClass = function(record, index) {
var active = record.get('active'); // burada ılgılı kaydın içeriğine ulaşılır
if (!active) { // burada record ile ilgili logic işlemler yapılır.
return 'passive-products'; // CSS sınıfı geri döndürülür
@tayfunoziserikan
tayfunoziserikan / gist:2576474
Created May 2, 2012 13:18
remote combobobox form load
/**
* Load for record from grid data
*
* @param {Ext.data.Model} record
*/
editPersonnel: function(record) {
var me = this,
formWin = me.application.getViewport().add(
Ext.widget('personnelManager_form', {
action: 'edit'
##Userable
module Userable
def self.included(base)
base.has_one :user, :as => :userable, :dependent => :destroy, :autosave => true
base.validate :user_must_be_valid
base.alias_method_chain :user, :autobuild
base.extend ClassMethods
base.define_user_accessors
end
en:
date:
order:
- :year
- :month
- :day
wice_grid:
show_filter_tooltip: Show filter
hide_filter_tooltip: Hide filter
csv_export_tooltip: Export to CSV
@tayfunoziserikan
tayfunoziserikan / gist:5165529
Last active December 14, 2015 23:28
Location selector
resources = []
selectors = []
$("select[data-locations=true]").each ->
el = $(this)
resources[el.data('parent')] = "/locations/#{el.data('resource')}.json"
selectors[el.data('parent')] = el.change ->
if el.data('child')
loadLocations(el.data('child'), el.data('parent'), el.val()) if el.val()
else