Skip to content

Instantly share code, notes, and snippets.

View ZhukV's full-sized avatar
🏠
Working from home

Vitaliy Zhuk ZhukV

🏠
Working from home
View GitHub Profile
@ZhukV
ZhukV / ds18b20.c
Created January 29, 2014 19:22
Work with temperature sensor DS18B20
/**
ds18b20.c - work with temperature sensor DS18B20
Author: Vitaiy Zhuk
*/
#include <util/delay.h>
#include "ds18b20.h"
/**
@ZhukV
ZhukV / AttachModel.php
Created April 26, 2013 19:41
Abstract attach model for upload files in Symfony 2
<?php
namespace Acme\DemoBundle\Model;
use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
* Abstract class for control attachments model (Image, flash, other files)
*
* For upload files in your entity please usage ORM\HasLifecycleCallbacks (preUpdate, prePersist)
@Shilo
Shilo / UIImage+Additions.h
Created October 17, 2011 07:43
A UIImage category that will replace or remove colors. This allows multiple colors to be changed on a single image, until it has alpha values.
//
// UIImage+Additions.h
// Sparrow
//
// Created by Shilo White on 10/16/11.
// Copyright 2011 Shilocity Productions. All rights reserved.
//
#define COLOR_PART_RED(color) (((color) >> 16) & 0xff)
#define COLOR_PART_GREEN(color) (((color) >> 8) & 0xff)
@beberlei
beberlei / ActiveEntity.php
Created June 19, 2011 11:11
Doctrine 2.2 Traits Preview
<?php
use Doctrine\ORM\EntityManager,
Doctrine\ORM\Configuration,
Doctrine\ORM\Mapping\ClassMetadata;
/**
* Active Entity trait
*
* Limitations: a class can only ever be assocaited with ONE active entity manager. Multiple entity managers