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
If you're using msysgit with the OpenSSH tools, you need to either create ~/.ssh/id_rsa, or create a git config in ~/.ssh/config which points to your key. | |
Here's an example of a Git config for bitbucket that will use the correct username, and a key other than the default key (in case you maintain one key for SSH connections, and another for git accounts). | |
Host heroku.com | |
Hostname heroku.com | |
IdentityFile /C/keys/yourkey.key | |
Once in git bash, you can run two commands to add your key to your current session's ssh-agent to avoid having to repeatedly type the key's password. | |
eval `ssh-agent` |
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
git log # to see the last commit id | |
git reset --hard 5a7404742c85 | |
#or | |
#git reset --hard HEAD^ # use --hard if you don't care about keeping the changes you made | |
git commit -am 'restoring the file I removed on accident' | |
git push origin master --force |
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(){ | |
$(window).resize(function(){ | |
// get the screen height and width | |
var maskHeight = $(window).height(); | |
var maskWidth = $(window).width(); | |
// calculate the values for center alignment | |
var dialogTop = (maskHeight - $('#dialog-box').height())/2; | |
var dialogLeft = (maskWidth - $('#dialog-box').width())/2; |
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
For smaller companies (it's not clear how big yours is), three environments (dev, stage, production) are common. Larger companies will often have a QA environment between dev and stage. | |
These normally break down as follows: | |
dev: Working code copy. Changes made by developers are deployed here so integration and features can be tested. This environment is rapidly updated and contains the most recent version of the application. | |
qa: (Not all companies will have this). Environment for quality assurance; this provides a less frequently changed version of the application which testers can perform checks against. This allows reporting on a common revision so developers know whether particular issues found by testers has already been corrected in the development code. | |
staging: This is the release candidate, and this environment is normally a mirror of the production environment. The staging area contains the "next" version of the application and is used for final stress testing and client/manager approvals before |
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
<select id="form_type"> | |
<option value="1">c</option> | |
<option value="2">d</option> | |
<option value="3">e</option> | |
</select> | |
$("#form_type option[value='1']").remove(); |
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
<input type="checkbox" value="1" id="all"/>All | |
<input type="checkbox" value="2" id="m"/>Monday | |
<input type="checkbox" value="3" id="t"/>Tuesday | |
<div id="qq"></div> <button id="bb">Click</button> | |
var selected = new Array(); | |
$(document).ready(function() |
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
beforeClose: function() { | |
var $this = $(this); | |
$this | |
.dialog("widget") | |
.effect("transfer", { | |
to: "#form-preview", | |
className: "ui-effects-transfer" |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<title>Пример для css-live.ru</title> | |
<style type="text/css"> | |
* { margin: 0; padding: 0; } | |
p { padding: 10px; } | |
#left { position: absolute; left: 0; top: 0; width: 50%; } |
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
$model=Post::model(); | |
$transaction=$model->dbConnection->beginTransaction(); | |
try | |
{ | |
// find and save are two steps which may be intervened by another request | |
// we therefore use a transaction to ensure consistency and integrity | |
$post=$model->findByPk(10); | |
$post->title='new post title'; | |
if($post->save()) | |
$transaction->commit(); |
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
<div class="loading">Loading…</div> | |
/* Absolute Center CSS Spinner */ | |
.loading { | |
position: fixed; | |
z-index: 999; | |
height: 2em; |