This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna! | |
([一-龯]) | |
Regex for matching Hirgana or Katakana | |
([ぁ-んァ-ン]) | |
Regex for matching Non-Hirgana or Non-Katakana | |
([^ぁ-んァ-ン]) | |
Regex for matching Hirgana or Katakana or basic punctuation (、。’) |
# | |
# nginx configuration example for CakePHP 2.x | |
# | |
server { | |
listen 80; | |
server_name cakephp2.example; | |
root /var/www/cakephp2/app/webroot; | |
access_log /var/log/nginx/cakephp2.access.log; | |
error_log /var/log/nginx/cakephp2.error.log; |
<html> | |
<body> | |
<p>Here are Webber’s points:</p> | |
<ul> | |
<li>If a method can be static, declare it static. Speed improvement is by a factor of 4.</li> | |
<li>echo is faster than print.(<em>* compare with list from phplens by John Lim</em>)</li> | |
<li>Use echo’s multiple parameters instead of string concatenation.</li> | |
<li>Set the maxvalue for your for-loops before and not in the loop.</li> | |
<li>Unset your variables to free memory, especially large arrays.</li> | |
<li>Avoid magic like __get, __set, __autoload</li> |
First of all you need to be able to run MAMP in port 80. This is a "heat check" if you don't have any process jamming http ports. You can check it like this:
sudo lsof | grep LISTEN
If you do happen to have any process with something like this *:http (LISTEN)
, you are in trouble. Before with adventure check if it isn't MAMP itself (yeah, you should close that beforehand)
ps <pid of that process>
If you don't see MAMP, you are in good hands, I have just the thing for you:
<?php | |
/** @var Mage_Eav_Model_Entity_Setup $installer */ | |
$installer = $this; | |
$installer->startSetup(); | |
$this->addAttribute( | |
'catalog_category', | |
'my_custom_attribute', | |
array( | |
'group' => 'General Information', |
Before unsheathing pandas on your next data munging problem, consider pulling out your unix toolbox to slice-and-dice stuff old-school.
Unix pipelines will take you far. Repeated operations can then be encapsulated in a script.
In addition to your standard stable of unix scripting languages (bash
and
other shell dialects, sed
, awk
, and perl
), there are a handful standard
power tools (jot
, rs
, etc) and add-ons worth your consideration. Use jot
to print sequential or random data and rs
to reshape a data array.
SSHPass is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.
apt-get install sshpass
require "rubygems" | |
# Install the Chef gem into the private Vagrant gem repo | |
CHEF_VERSION = '11.8.2' | |
def with_vagrant_gem_path | |
@old_gem_path = ENV["GEM_PATH"] | |
@old_gem_home = ENV["GEM_HOME"] | |
Gem.paths = ENV["GEM_PATH"] = ENV["GEM_HOME"] = "#{ENV['HOME']}/.vagrant.d/gems" | |
return yield |