Skip to content

Instantly share code, notes, and snippets.

@rscata
rscata / git-open.sh
Created April 17, 2018 07:04 — forked from amjith/git-open.sh
git-open.sh
#!/bin/bash
dirty=`git status --porcelain -uno | sed s/^...//`
last_modified=`git show --pretty="format:" --name-only HEAD`
if [ -n "$dirty" ]; then
echo $dirty
else
echo $last_modified
fi
@rscata
rscata / error_log.php
Created June 27, 2013 09:33
error log
<?php
error_log('A connection to the database could not be opened.', 1, '[email protected]'); //send error to email
error_log('A connection to the database could not be opened.', 3, '/var/log/php_errors.log'); //log into a file
?>
@rscata
rscata / carch_data.php
Created June 13, 2013 12:38
cleen catch data, post or get
$clean = array();
switch($_POST['color']) {
case 'red':
case 'green':
case 'blue'
$clean['color'] = $_POST['color'];
default: /*ERROR*/
break;
}
@rscata
rscata / modal.html
Created June 12, 2013 14:49
modal example
<a class="btn" data-toggle="modal" href="#myModal">Launch Modal</a>
<div class="modal hide" id="myModal">
<div class="modal-header">
<button class="close" data-dismiss="modal">×</button>
<h3>Modal header</h3>
</div>
<div class="modal-body">
<p>One fine body…</p>