start new:
tmux
start new with session name:
tmux new -s myname
{ | |
"name": "naderman/sample-meta-package", | |
"version": "1.0.0", | |
"type": "metapackage", | |
"require": { | |
"naderman/package1": "self.version", | |
"naderman/package2": "self.version", | |
"naderman/package3": "2.0.3" | |
} | |
} |
<html> | |
<head> | |
<title>D3 Axis Example</title> | |
<script src="http://d3js.org/d3.v2.js"></script> | |
<style type="text/css"> | |
.axis path, | |
.axis line { | |
fill: none; |
#!/usr/bin/php | |
<?php | |
/** | |
* .git/hooks/pre-commit | |
* | |
* This pre-commit hooks will check for PHP error (lint), and make sure the code | |
* is PSR compliant. | |
* | |
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer) | |
* |
The [RFC for a new simple to use password hashing API][rfc] has just been accepted for PHP 5.5. As the RFC itself is rather technical and most of the sample codes are something you should not use, I want to give a very quick overview of the new API:
Everybody knows that you should be hashing their passwords using bcrypt, but still a surprising number of developers uses insecure md5 or sha1 hashes (just look at the recent password leaks). One of the reasons for this is that the crypt() API is ridiculously hard to use and very prone to programming mistakes.
// convert dp to pixel. | |
function dpToPixel(dp) { | |
return ( parseInt(dp) * (Titanium.Platform.displayCaps.dpi / 160)); | |
} | |
// convert pixel to dp. | |
function pixelToDp(px) { | |
return ( parseInt(px) / (Titanium.Platform.displayCaps.dpi / 160))+'dp'; | |
} |
<?xml version="1.0" encoding="UTF-8"?> | |
<w:document xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" | |
xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" | |
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" | |
xmlns:w10="urn:schemas-microsoft-com:office:word" | |
xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" | |
xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" | |
xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" |
<?php | |
/* Caveat: I'm not a PHP programmer, so this may or may | |
* not be the most idiomatic code... | |
* | |
* FPDF is a free PHP library for creating PDFs: | |
* http://www.fpdf.org/ | |
*/ | |
require("fpdf.php"); | |
class PDF extends FPDF { |
var args = arguments[0] || {}; | |
$.rowId.text=args.rowId; | |
$.itemName.text=args.itemName; | |
function closeme(){ | |
$.win.close(); | |
} |
-- install packages | |
# yum update | |
# yum groupinstall "Development Tools" "Additional Development" | |
-- epel for redis, libyaml, pip, qtwebkit-devel | |
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm | |
# yum install libicu-devel libyaml-devel redis wget python-pip qt-devel qtwebkit-devel | |
-- install ruby |