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 | |
| echo "Hello from VIM"; |
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 deployer_autoload($name) { | |
| $libDirs = array( | |
| './deployer/lib/deployer/', | |
| './lib/deployer/', | |
| ); | |
| foreach ($libDirs as $libDir){ | |
| if(strpos($name, '_')>0) { | |
| $filePath = $libDir . str_replace('_','/',$name).'.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
| map <F11> :wall<CR>:!svn commit -m 'changes' %<CR> |
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
| #!/usr/bin/env php | |
| <?php | |
| function data_uri($file, $mime) | |
| { | |
| $contents = file_get_contents($file); | |
| $base64 = base64_encode($contents); | |
| return ('data:' . $mime . ';base64,' . $base64); | |
| } | |
| $url = $mime = false; |
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
| function! Img2Data() | |
| python << EOF | |
| import vim, urllib2, base64, mimetypes | |
| from urlparse import urlparse | |
| try: | |
| url = vim.eval('@+') | |
| o = urlparse(url) | |
| file_type = mimetypes.guess_type(url)[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 | |
| if( '20110204024217300000' == '20110204024217300264' ) | |
| echo 'equal'; | |
| else | |
| echo 'not equal'; |
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 dog { | |
| public $name = ''; | |
| public function setName($name) { | |
| $this->name = $name; | |
| } | |
| public function getName() { | |
| return $this->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
| #!/usr/bin/env php | |
| <?php | |
| class ServerMonitor { | |
| public $hosts = array( | |
| 'wp.pl', | |
| 'ukrywamsieglebokopl.tld', | |
| 'google.pl', | |
| ); |
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
| #!/usr/bin/env php | |
| <?php | |
| class ServerMonitor { | |
| public $hosts = array( | |
| 'DNS Server' => '10.0.0.215', | |
| 'CRM RC' => 'crm.rc.edp', | |
| 'CRM Work' => 'crm.w.edp', | |
| 'CRM Prod' => 'crm.pl.edp', | |
| 'Jenikins' => 'ci.w.edp', |
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
| # 1) Point *.example.com in your DNS setup to your server. | |
| # | |
| # 2) Setup an Apache vhost to catch the star pointer: | |
| # | |
| # <VirtualHost *:80> | |
| # ServerName *.example.com | |
| # </VirtualHost> | |
| # | |
| # 3) Set the current account from the subdomain | |
| class ApplicationController < ActionController::Base |
OlderNewer