Skip to content

Instantly share code, notes, and snippets.

View MickaelCruzDB's full-sized avatar

Mickaël Cruz MickaelCruzDB

View GitHub Profile
@IBAction func FilterAction(sender: AnyObject) {
PortfolioView.deleteItemsAtIndexPaths([NSIndexPath(forItem: 0, inSection: 0), NSIndexPath(forItem: 1, inSection: 0), NSIndexPath(forItem: 2, inSection: 0)])
self.PortfolioView!.reloadData()
}
@IBAction func FilterAction(sender: AnyObject) {
PortfolioView.deleteItemsAtIndexPaths([NSIndexPath(forItem: 0, inSection: 0), NSIndexPath(forItem: 1, inSection: 0), NSIndexPath(forItem: 2, inSection: 0)])
imageFileNames.removeRange(0...2)
self.PortfolioView!.reloadData()
}
from django import forms
TABLE_CAT = (
(GASOLINE_ENGINES, 'Gasoline Engines'),
(DIESEL_ENGINES, 'Diesel Engines'),
(EXHAUST_AFTERTREATMENT, 'Exhaust Aftertreatment'),
(ELECTRIFICATION, 'Electrification'),
(DRIVETRAIN_EFFICIENCY, 'Drivetrain Effieciency'),
)
from django.db import models
class Product(models.Model):
YES = '1'
NO = '0'
SandA = 'S&A'
ES = 'ES'
FEM = 'FEM'
HEV = 'HEV'
TR = 'TR'
from django.contrib import admin
from PowertrainExhibit.models import Product, Space
from django.forms import ModelForm
from suit_redactor.widgets import RedactorWidget
from suit.admin import SortableModelAdmin
class PostForm(ModelForm):
class Meta:
widgets = {
'body': RedactorWidget(editor_options={'lang': 'en'}),
override func preferredLayoutAttributesFittingAttributes(layoutAttributes: UICollectionViewLayoutAttributes) -> UICollectionViewLayoutAttributes! {
return layoutAttributes
}
import UIKit
class ProductCell: UICollectionViewCell {
// The collection view cell's objects
var imageView: UIImageView!
var caption: UILabel!
var category : UILabel!
var bu : UILabel!
override func preferredLayoutAttributesFittingAttributes(layoutAttributes: UICollectionViewLayoutAttributes) -> UICollectionViewLayoutAttributes! {
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
var appDel:AppDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
var context:NSManagedObjectContext = appDel.managedObjectContext!
// Initialize the reusable Collection View Cell with our custom class
icon = PortfolioView.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as! ProductCell
iconiPhone47 = PortfolioViewiPhone47.dequeueReusableCellWithReuseIdentifier(reuseIdentifieriPhone47, forIndexPath: indexPath) as! ProductCelliPhone47
<div id="nav">
<ul>
<li><a class="<?php if (is_home()) echo 'current'; ?>" href="#">Menu1</a></li>
<li><a class="<?php if (is_single('contact')) echo 'current'; ?>" href="#">Menu2</a></li>
<li><a class="<?php if (is_single('about')) echo 'current'; ?>" href="#">Menu3</a></li>
</ul>
</div>
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
var nav: UIViewController = NavViewController()
let navigationController = UINavigationController(rootViewController: nav)
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
self.window!.rootViewController = navigationController
self.window!.backgroundColor = UIColor.whiteColor()
self.window!.makeKeyAndVisible()