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
# Monitor HTTP requests being made from your machine with a one-liner.. | |
# Replace "en1" below with your network interface's name (usually en0 or en1) | |
sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*" | |
# OR.. to be able to use as "httpdump" from anywhere, drop this into ~/.bash_profile: | |
# (again replace "en1" with correct network interface name) | |
alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*"" | |
# All the above tested only on OS X. |
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
var DateHelper = { | |
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time | |
// Ruby strftime: %b %d, %Y %H:%M:%S GMT | |
time_ago_in_words_with_parsing: function(from) { | |
var date = new Date; | |
date.setTime(Date.parse(from)); | |
return this.time_ago_in_words(date); | |
}, | |
time_ago_in_words: function(from) { |
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
# Ubuntu Server Upgrade | |
apt-get update | |
apt-get install update-manager-core | |
do-release-upgrade -d | |
# Ubuntu Dist Update | |
apt-get update | |
apt-get dist-upgrade |
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
macruby -r snapper.rb -e "Snapper.new.save('http://serenity.su', 'serenity.su.png')" |
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
var reader = new FileReader(); | |
reader.onload = function(e) { | |
var bin = e.target.result; | |
// bin is the binaryString | |
}; | |
reader.readAsBinaryString(file); |
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 | |
$manager = new Zend_Cache_Manager; | |
$dbCache = array( | |
'frontend' => array( | |
'name' => 'Core', | |
'options' => array( | |
'lifetime' => 7200, | |
'automatic_serialization' => true |
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 | |
/** | |
* Создаю фид | |
*/ | |
$feed = new Zend_Feed_Writer_Feed; | |
$feed->setTitle('Заголовок блога'); | |
$feed->setLink('http://www.example.com'); | |
$feed->setFeedLink('http://www.example.com/atom', 'atom'); | |
$feed->addAuthor(array( |
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 | |
$textile = Zend_Markup::factory('Textile'); | |
// <strong>жирный текст</strong> и <em>курсивный текс</em> | |
echo $textile->render('*жирный текст* и _курсивный текс_'); |
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 = new Zend_Date(); | |
$date->setLocale('ru_RU'); | |
$liveDocx = new Zend_Service_LiveDocx_MailMerge(); | |
$liveDocx->setUsername('myUsername') | |
->setPassword('myPassword'); |
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 | |
// <!DOCTYPE html> | |
echo $view->doctype('HTML5'); | |
// <meta charset="UTF-8"> | |
echo $view->headMeta()->setCharset('UTF-8'); |
OlderNewer