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 return array ( | |
| 'url' => 'https://xaviesteve.com/', | |
| 'content' => '<!doctype html><html>...</html>', | |
| 'cookies' => '__cfduid=d3fa669e1069e72c2e47d127ab9b8e11f1465390629', | |
| 'http_code' => 200, | |
| 'content_type' => 'text/html; charset=UTF-8', | |
| 'header_size' => 578, | |
| 'request_size' => 229, | |
| 'filetime' => -1, | |
| 'ssl_verify_result' => 0, |
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 | |
| public function view($filename = 'home') { | |
| // Default values for every View | |
| $data = array( | |
| "app_title" => $this->app_title, | |
| "app_tagline" => $this->app_tagline, | |
| "app_url" => $this->app_url, | |
| "app_version" => $this->app_version, | |
| "user_name" => $this->user_name, | |
| ); |
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 | |
| function encodecsv($string) { | |
| if(strpos($string, ',') !== false || strpos($string, '"') !== false || strpos($string, "\n") !== false) { | |
| $string = '"' . str_replace('"', '""', $string) . '"'; | |
| } | |
| return $string; | |
| } |
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 | |
| // Downloading a file | |
| header("Content-type: application/csv"); | |
| header("Content-Disposition: attachment; filename=".date('Ymd-His ').$this->query.".csv"); | |
| header("Pragma: no-cache"); | |
| header("Expires: 0"); | |
| // Check if file exists |
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
| // With for..in | |
| var stuff, key; | |
| stuff = []; | |
| stuff[0] = "zero"; | |
| stuff[9999] = "nine thousand nine hundred and ninety-nine"; | |
| stuff.name = "foo"; | |
| for (key in stuff){ | |
| if (stuff.hasOwnProperty(key) && String(Number(key)) === key) { | |
| console.log("stuff[" + key + "] = " + stuff[key]); |
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
| @-webkit-keyframes imageBeat, | |
| @-moz-keyframes imageBeat, | |
| @-ms-keyframes imageBeat, | |
| @-o-keyframes imageBeat, | |
| @keyframes imageBeat { | |
| 0% { transform: scale(1); } | |
| 2% { transform: scale(1.02); } | |
| 5% { transform: scale(1); } | |
| 100% { transform: scale(1); } | |
| } |
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
| html { | |
| box-sizing: border-box; | |
| } | |
| *, | |
| *:before, | |
| *:after { | |
| box-sizing: inherit; | |
| } | |
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
| sudo nano /Applications/MAMP/conf/apache/httpd.conf | |
| ------------------------- | |
| NameVirtualHost * | |
| <VirtualHost *> | |
| DocumentRoot "/Users/xavi/Dropbox/WWW" | |
| ServerName localhost | |
| </VirtualHost> |
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
| /* Twitter Bootstrap LESS mixin */ | |
| .transition(@property: all, @duration: 0.2s, @animation: ease-in) { | |
| transition:@property @duration @animation; | |
| } | |
| // Used like | |
| .transition(); | |
| .transition(all, .2s); |