Skip to content

Instantly share code, notes, and snippets.

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

Taras Labiak kissarat

🏠
Working from home
View GitHub Profile
<?php
class Entity {
protected $tableName;
protected $modified = null;
protected $pdo;
public function reset() {
load($this->modified);
}
doNothing = function () {};
if (!Object.prototype.__defineGetter__) {
Object.prototype.__defineGetter__ = function(name, getter) {
Object.defineProperty(this, name, { get: getter });
}
}
function definePrototypeProperty (name, getter) {
Object.defineProperty(this.prototype, name, { get: getter });
<?php
require_once 'config.php';
class Description {
public $data;
public $name;
/* public static $map = array(
'COLUMN_NAME' => 'name',
'IS_NULLABLE' => 'required',
<?php //phpinfo();exit; ?>
<!DOCTYPE HTML>
<html>
<body>
<?php
if (!isset($_FILES['file']))
goto render;
class File {
protected $filename;
<?php
/**
* User: Taras Labiak
* Date: 3/9/13
* Time: 2:39 PM
*/
class EntityGenerator {
private $entityName;
<html>
<head>
<style type="text/css">
canvas {
border: 1px solid #000000;
}
</style>
<script type="text/javascript">
var canvas;
var gra;
use `bitch`;
drop view if exists `meta_table`;
create view `meta_table` as
select
`TABLES`.`TABLE_NAME` as `table`,
`COLUMN_NAME` as `column`,
`COLUMN_DEFAULT` as `default`,
`IS_NULLABLE` = 'NO' as `require`,
`DATA_TYPE` as `type`,
<?php
define('PDO_ERROR_MESSAGE', 2);
try {
$connection = new PDO('mysql:host=localhost;dbname=contact_db', 'root', '1', array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
$statement = $connection->query('SELECT * FROM contact');
?>
<table>
<?php
while($row = $statement->fetch(PDO::FETCH_ASSOC)) {
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
#box {
position: absolute;
left: 0;
top: 0;
width: 100px;
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
#canvas {
/*width: 1280px;*/
/*height: 1024px;*/
image-rendering: optimize-contrast;
border: black 1px solid;