This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import os,sys,time | |
import fabric | |
from fabric.contrib.files import * | |
from fabric.api import * | |
from fabric.operations import * | |
import ilogue.fexpect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from fabric.api import task | |
from fabric.api import run | |
from fabric.api import local | |
from fabric.api import env | |
from fabric.api import cd | |
from fabric.api import prefix | |
from fabric.api import hide | |
# Расположение зависимостей для проекта |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from deployment.cuisine import * | |
from fabric.api import * | |
from fabric.context_managers import * | |
from fabric.utils import puts | |
from fabric.colors import red, green | |
import simplejson | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from deployment.cuisine import * | |
from fabric.api import * | |
from fabric.context_managers import * | |
from fabric.utils import puts | |
from fabric.colors import red, green | |
import simplejson | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from deployment.cuisine import * | |
from fabric.api import * | |
from fabric.context_managers import * | |
from fabric.utils import puts | |
from fabric.colors import red, green | |
import simplejson | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function calculateDateDiff($strStart, $strEnd) { | |
$objStart = DateTime::createFromFormat("m/j/Y g:i:s A", $strStart); | |
$objEnd = DateTime::createFromFormat("m/j/Y g:i:s A", $strEnd); | |
// Return Total Seconds | |
return $objEnd->getTimestamp() - $objStart->getTimestamp(); | |
// Return formatted diference (7hrs 5mins and 43 seconds) | |
return $objStart->diff($objEnd)->format('%hhrs %imins and %sseconds '); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function calculateDateDiff($strStart, $strEnd) { | |
$parts = explode(' ', $strStart); | |
$dates = explode('/', $parts[0]); | |
$times = explode(':', $parts[1]); | |
$unix_start = mktime($times[0], $times[1], $times[2], $dates[0], $dates[1], $dates[2]); | |
$parts = explode(' ', $strEnd); | |
$dates = explode('/', $parts[0]); | |
$times = explode(':', $parts[1]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyDateTime extends DateTime | |
{ | |
protected $_daysOfTheWeek = array('sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'); | |
public function lastDayOfTheMonth() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function format_datetime($examine_query) | |
{ | |
$split_query = explode("FROM", $examine_query); | |
$result = mysql_query($examine_query); | |
$numfields = mysql_num_fields($result); | |
for ($i = 0; $i < $numfields; $i++) | |
{ | |
$field_info = mysql_field_type($result, $i); | |
$field_name = mysql_field_name($result, $i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// DATE/TIME Manipulation for dates from php to mysql and back again | |
// get time and date right now for inserting datetime into mysql | |
// the field in the db should be set as a mysql "datetime" field type | |
// First - set the local timezone | |
date_default_timezone_set('America/New_York') | |
// use this in a hidden form field to insert the time into db record | |
echo date('Y-m-d H:i:s',time()); |
NewerOlder