Skip to content

Instantly share code, notes, and snippets.

View kate-kate's full-sized avatar
🐛
hello world

Kate Kuznetsova kate-kate

🐛
hello world
  • RiverWay
  • Russia
View GitHub Profile
@kate-kate
kate-kate / perl-replace
Created May 28, 2014 20:11
Example of PERL replace
perl -i -pe 's/OLD/NEW/g;' *.html
@kate-kate
kate-kate / Last day of the month
Created June 4, 2014 19:14
i.e. if we don't know the month
strtotime('31.05.2014')===strtotime('00.06.2014')
SELECT FLOOR( call.created_at % ( 3600 *24 ) ) AS `interval` , COUNT( * ) AS c, call.campaign_id, campaign.name
FROM `call`
LEFT JOIN `campaign` ON campaign.id = call.campaign_id
WHERE 1
GROUP BY `interval` , campaign_id
<param name="wmode" value="opaque" />
http://www.greensock.com/get-started-js/
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions?redirectlocale=en-US&redirectslug=JavaScript%2FGuide%2FRegular_Expressions#Using_Simple_Patterns
public function actionFindTables()
{
$res = [];
$text = file_get_contents('zl30.html', 'web');
$rows = preg_split('/=+/', $text);
foreach ($rows as $row) {
list($title, $body) = preg_split('/-{5,}/', $row);
$html = '<h1><br />' . $title . '<br /><br /></h1>';
$html .= '<table border="1" cellspacing="0" cellpadding="4"><colgroup span="5" width="85">';
$html .= '<thead><tr><td align="left" height="17">№</td><td align="left">Part No.</td>
mysqldump -uroot -proot --where="column=val" dbName tableName > ~/result.sql
mysqldump -uroot -proot dbName < one_table.sql
или
mysql -uroot -proot
use dbName
source ~/one_table.sql