View db_backup.sh
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
#/bin/bash | |
/usr/bin/mysqldump --user=DB_USER --password='DB_PASSWORD' --databases DB_NAME | gzip > /path/to/backup/DB_NAME-`date +%Y%m%d%H%M`.sql.gz | |
find /path/to/backup -name "*.gz" -mtime +60 -exec /bin/rm {} \; |
View real_time_log.sh
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
#!/bin/bash | |
remoteuser=user_name | |
remotecomputer=some_ip_address | |
ssh -l "$remoteuser" "$remotecomputer" "tail -f path/to/log/files/log-`date +"%Y-%m-%d"`.php" |
View youtube.public.feed.js
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
//See more http://code.google.com/apis/youtube/2.0/developers_guide_protocol_api_query_parameters.html | |
$.ajax({ | |
type:'GET', | |
dataType:'jsonp', | |
//url:'http://gdata.youtube.com/feeds/users/USERNAME/uploads?alt=json', //also usable, but less awesome | |
url:'http://gdata.youtube.com/feeds/api/videos', | |
data:{author:'USERNAME', v:2, orderby:'published', alt:'json', 'max-results':10}, | |
success:function(data, textStatus, XMLHttpRequest) { | |
console.log(data); | |
}, |
View jquery.plugin.template.js
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($){ | |
var environment = {}; | |
var methods = { | |
init:function(options) { | |
var options = $.extend({}, options); | |
return this.each(function() { |
View zend.data.mapper.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
<?php | |
//Abstract "model" class | |
class App_Model_Abstract | |
{ | |
public function __construct(array $options = null) | |
{ | |
if (is_array($options)) { | |
$this->setOptions($options); | |
} |
View zend.bootstrap.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
<?php | |
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap | |
{ | |
protected function _initLayoutHelper() | |
{ | |
$this->bootstrap('frontController'); | |
$layout = Zend_Controller_Action_HelperBroker::addHelper( | |
new AppName_Controller_Action_Helper_LayoutLoader()); |
View twitter.public.timeline.js
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
$.ajax({ | |
type:'GET', | |
dataType:'jsonp', | |
url:'http://api.twitter.com/1/statuses/user_timeline.json', | |
data:{screen_name:'USERNAME', include_rts:1}, //show retweets | |
success:function(data, textStatus, XMLHttpRequest) { | |
var tmp = false; | |
var results = $('#twitter_results'); | |
//console.log(data); | |
for(i in data) { |
View twitter.linkify.js
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
String.prototype.linkify_tweet = function() { | |
var tweet = this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/g, function(url) { | |
var wrap = document.createElement('div'); | |
var anch = document.createElement('a'); | |
anch.href = url; | |
anch.target = "_blank"; | |
anch.innerHTML = url; | |
wrap.appendChild(anch); | |
return wrap.innerHTML; | |
}); |
View curl_results.sh
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
#With Basic Auth | |
curl --user someuser:somepassword -d 'some_post=variables&go=here' http://api.somecoolapi.com/json.somedata | python -mjson.tool >> /path/of/file/to/export/to.txt | |
#Without Basic Auth | |
curl -d 'some_post=variables&go=here' http://api.somecoolapi.com/json.somedata | python -mjson.tool >> /path/of/file/to/export/to.txt | |
#More Goodies: http://www.davidslog.com/1187630823/format-xml-json-from-command-line |
View EEembed.html
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
<!-- Some embed code in any template --> | |
{embed='site/_header' title='Some Title' keywords='some,keywords' description='a description'} | |
<!-- site.group/_header.html --> | |
<!doctype html> | |
<html> | |
<head> | |
<title>{embed:title}</title> | |
<meta name="keywords" content="{embed:keywords}" /> | |
<meta name="description" content="{embed:description}" /> |
OlderNewer