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
#!/bin/bash | |
MONGODUMP_PATH="/usr/bin/mongodump" | |
MONGO_HOST="prod.example.com" | |
TIMESTAMP=`date +%F-%H%M` | |
S3_BUCKET_NAME="bucketname" | |
S3_BUCKET_PATH="mongodb-backups" | |
# Create backup | |
$MONGODUMP_PATH --host $HOST |
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
<?php | |
/****************************************************************************************** | |
These helpers are required for either: | |
link_to() | |
or | |
url_for() | |
******************************************************************************************/ |
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> | |
<html> | |
<head></head> | |
<body> | |
<form class="form-horizontal" action="<?php echo url_for('module/action') ?>" method="post"> | |
<h2>Set of fields</h2> | |
<?php foreach(array($formObj['field1'], $formObj['field2']) as $sfFormFieldObj): ?> | |
<?php printAsBootstrapForm($formObj, $sfFormFieldObj); ?> | |
<?php endforeach; ?> | |
</form> |
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
# Edit this file to introduce tasks to be run by cron. | |
# | |
# Each task to run has to be defined through a single line | |
# indicating with different fields when the task will be run | |
# and what command to run for the task | |
# | |
# To define the time you can provide concrete values for | |
# minute (m), hour (h), day of month (dom), month (mon), | |
# and day of week (dow) or use '*' in these fields (for 'any').# | |
# Notice that tasks will be started based on the cron's system |
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
#!/bin/bash | |
mysqldump -h localhost -u foouser --password=foopass foodb | gzip > /var/db_backup.sql.gz |
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
#!/bin/bash | |
cd /var/ && mongodump |
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 arrayUnique(ar) | |
{ | |
if(ar.length && typeof ar!=='string') | |
{ | |
var sorter = {}; | |
var out = []; | |
for(var i=0,j=ar.length;i<j;i++) | |
{ | |
if(!sorter[ar[i]+typeof ar[i]]) | |
{ |
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
mkdir prj1 | |
cd prj1 | |
git init | |
touch README | |
git add . | |
git commit -m "Added blank readme" | |
git remote add origin git@server:prj1.git | |
git push origin master |
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
<script type="text/javascript"> | |
function getPage(id) | |
{ | |
id = prompt('Enter ID: '); | |
window.location.href='http://domain.com/module/action?id=' + id; | |
return false; | |
} | |
</script> |
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
<script type="text/javascript"> | |
function listen_for_uncheck_all($checkboxes) | |
{ | |
jQuery('#uncheckalllink').unbind('click').bind('click', function(){ | |
$checkboxes.removeAttr("checked"); | |
jQuery('#uncheckalllink').html('Check All'); | |
listen_for_check_all($checkboxes); |