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
# find only files and chmod | |
# because I never remember the syntax | |
find . -type f -exec sudo chmod 664 {} \; | |
# untar .tar.gz | |
tar xvzf file.tar.gz | |
# untar .tar.bz2 | |
tar xjvf file.tar.b |
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
/* | |
This function is from my answer to a question on Stack Overflow | |
http://stackoverflow.com/questions/4963673/get-url-array-variables-in-javascript-jquery/4963817#4963817 | |
*/ | |
function getQueryString () { | |
var ret = {}; | |
var parts = (document.location.toString().split('?')[1]).split('&'); |
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 | |
mail( | |
'ron.burgundy@KVWNTV.com', | |
'This is the subject', | |
'This is a message.' | |
); | |
?> |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Example how to send an email</title> | |
<link rel="stylesheet" href="style.css" /> | |
</head> | |
<body> | |
<div id="mainwrap"> |
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
# Update the options for site settings: | |
UPDATE wp_options | |
SET | |
option_value = replace( | |
option_value, | |
'http://oldsite.com/path', | |
'http://spankingnew.com/otherpath' | |
) | |
WHERE |
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
var i,s,sc=['http://yourhostname.com/path/to/your/script.js'];if(!jQuery){sc.unshift('http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js');}for(i=0;i<sc.length;i++){s=document.createElement('script');s.src=sc[i];document.body.appendChild(s);}void(0); |
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
snippet grad | |
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='${1:#cccccc}', endColorstr='${2:#ffffff}'); | |
background: -webkit-gradient(linear, left top, left bottom, from($1), to($2)); | |
background: -moz-linear-gradient(top, $1, $2); | |
${3} | |
snippet box | |
-moz-box-shadow: ${1:1px} ${2:1px} ${3:0px} ${4:0px} ${5:rgba(0,0,0, 0.1)}; | |
-webkit-box-shadow: $1 $2 $3 $4 $5; | |
box-shadow: $1 $2 $3 $4 $5; | |
${6} |
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
function testcase (func) { | |
var i, d = new Date(); | |
for (i = 0; i < 10000; i++) { | |
func(); | |
} | |
return new Date() - d; | |
} | |
time1 = testcase(function () { | |
// test 1 |
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
function myFunction () { | |
// do something here | |
} | |
function otherFunction () { | |
// call the other function: | |
} |
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
// This function accepts either an array or a single value and | |
// returns an array of the values that didn't match the string | |
// provided in argument #2 | |
function y (myvar,str) { | |
// this variable will be returned from this function | |
var collection = []; | |
// Check if the provided variable is an array or not | |
if (myvar instanceof Array) { | |
// iterate through all elements and check if they |
OlderNewer