This file contains hidden or 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
public function get_short_created_at() | |
{ | |
$date = $this->get_attribute('created_at'); | |
if (is_string($date)){ | |
$dateObject = DateTime::createFromFormat('Y-m-d H:i:s', $date); | |
return $dateObject->format('Y-m-d'); | |
} | |
return $date; | |
} |
This file contains hidden or 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
CREATE TABLE `makers` ( | |
`id` int(10) unsigned NOT NULL, | |
`name` varchar(255) NOT NULL, | |
`description` varchar(255) NOT NULL, | |
`created_at` datetime NOT NULL, | |
`updated_at` datetime NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | |
-- |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
'use strict'; | |
var COMPILED = !0, goog = goog || {}; | |
goog.global = this; | |
goog.DEBUG = !1; | |
goog.LOCALE = "en"; | |
goog.provide = function (a) { | |
if (!COMPILED) { | |
if (goog.isProvided_(a)) | |
throw Error('Namespace "' + a + '" already declared.'); | |
delete goog.implicitNamespaces_[a]; |
This file contains hidden or 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
Route::filter('auth', function() | |
{ | |
if (Auth::guest()) | |
{ | |
// Save the attempted URL | |
Session::put('pre_login_url', URL::current()); | |
// Redirect to login | |
return Redirect::to('login'); | |
} |
This file contains hidden or 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
<button id="generateBtn">Show Wallpaper</button> | |
<select id="res"> | |
<option value="1">800x600</option> | |
<option value="2">1200x800</option> | |
<option value="3">1600x1200</option> | |
<option value="4">1920x1600</option> | |
</select> | |
<br> |
This file contains hidden or 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 Resetpass_Task { | |
public function run($arguments) | |
{ | |
$userid = $arguments[0]; | |
$newpass = $arguments[1]; | |
$user = User::find($arguments[0]); | |
if($user){ |
This file contains hidden or 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
Route::get('excel', function(){ | |
$objPHPExcel = new PHPExcel(); | |
$sheet = $objPHPExcel->getActiveSheet(); | |
$sheet->setCellValue('A1','Test value'); | |
$writer = new PHPExcel_Writer_Excel5($objPHPExcel); | |
$writer->save("test.xls"); | |
return Response::download('test.xls', 'test.xls'); | |
}); | |
This file contains hidden or 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
Route::get('ftp', function(){ | |
$ftp = SFTP::make('example.com', 'username', 'password'); | |
// connect to FTP server | |
if($ftp->connect()) { | |
print "Connection successful"; | |
// download a file from FTP server | |
// will download file "somefile.php" and | |
// save locally as "localfile.php" |
This file contains hidden or 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
https://github.com/ccoenraets/phonegap-workshop-solutions | |
http://blog.stevensanderson.com/2011/10/05/full-height-app-layouts-a-css-trick-to-make-it-easier/ |
This file contains hidden or 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
Hi. To integrate jcrop i used a done callback. This means i add jcrop only after successful upload. In general its look like this: on done you have data object. Data.result is an array of files' information returned from server. For each file (image) you need to create separate cropbox, and initialize jcrop plugin for each cropbox after image was loaded. Than post that data to server and handle croping of image on server side. Well, it's my solution, but there are many another ways. | |
Code: | |
var cropbox_indx = 0, //index of cropbox | |
img_data = {}, // keeps uploaded image data | |
crop_w = 150, | |
crop_h = 125; |