shortcut | action |
---|---|
c-k c-c | comment (there is no toggle comment!!) |
c-k c-c | uncomment |
c-. | resolve current class |
f7 | switch to code behind |
s-f7 | switch to design view for this code behind (then click source to view source) |
c-s-w | view current page in browser |
c-space | trigger intellisense when it's closed |
s-a-3, c-- | navigate back |
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
// ==UserScript== | |
// @name Userscript Name | |
// @namespace http://example.com/ | |
// @description Userscript Description | |
// @match http://example.com/* (or @include * to include all pages) | |
// @version 1.0 | |
// ==/UserScript== | |
// Inject JavaScript onto the page | |
function exec(fn) { |
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
# Example of job definition: | |
# .---------------- minute (0 - 59) | |
# | .------------- hour (0 - 23) | |
# | | .---------- day of month (1 - 31) | |
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ... | |
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat | |
# | | | | | | |
# * * * * * user-name command to be executed |
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
To enable PHP in Apache add the following to httpd.conf and restart Apache: | |
LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so | |
The php.ini file can be found in: | |
/usr/local/etc/php/5.6/php.ini | |
✩✩✩✩ PEAR ✩✩✩✩ | |
If PEAR complains about permissions, 'fix' the default PEAR permissions and config: | |
chmod -R ug+w /usr/local/Cellar/php56/5.6.4/lib/php |
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
As of go 1.2, a valid GOPATH is required to use the `go get` command: | |
http://golang.org/doc/code.html#GOPATH | |
`go vet` and `go doc` are now part of the go.tools sub repo: | |
http://golang.org/doc/go1.2#go_tools_godoc | |
To get `go vet` and `go doc` run: | |
go get golang.org/x/tools/cmd/vet | |
go get golang.org/x/tools/cmd/godoc |
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 | |
$myvar = 1; | |
function myfunction() | |
{ | |
// importing of globals is always by reference | |
global $myvar; | |
$myvar = 2; | |
} |
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
// in an .aspx file... | |
<%= Request.ServerVariables["SCRIPT_NAME"] %> | |
// in the code behind file... | |
Response.Write(Request.ServerVariables["SCRIPT_NAME"]); | |
Response.end(); |
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
-- MSSQL Server 2005/2008 offset example | |
DECLARE @RowsPerPage INT = 10, @PageNumber INT = 6 | |
SELECT SalesOrderDetailID, SalesOrderID, ProductID | |
FROM ( | |
SELECT SalesOrderDetailID, SalesOrderID, ProductID, | |
ROW_NUMBER() OVER (ORDER BY SalesOrderDetailID) AS RowNum | |
FROM Sales.SalesOrderDetail | |
) AS SOD | |
WHERE SOD.RowNum BETWEEN ((@PageNumber-1)*@RowsPerPage)+1 | |
AND @RowsPerPage*(@PageNumber) |
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
// debug | |
System.IO.File.WriteAllText("/Users/Mike/code/trails-website/debuglog.txt", "hello world"); |
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
SELECT * FROM table_with_tons_of_columns\G | |
# will show column -> value in list format instead of messed up table format! |