Skip to content

Instantly share code, notes, and snippets.

View rncrtr's full-sized avatar
😎
hacking on some code yo.

Ryan Carter rncrtr

😎
hacking on some code yo.
View GitHub Profile
pkill -9 -f unicorn
@rncrtr
rncrtr / heroku-multiple-apps
Created October 21, 2013 19:22
how to use a single repository in multiple apps on heroku (stage and prod)
heroku <command here> --app app-name-1234
cat /path/to/file | ssh root@<HOSTNAME_OR_IP> 'cat >> /path/to/file'
heroku pgbackups:restore HEROKU_POSTGRESQL_URL -a target-app \
`heroku pgbackups:url -a source app'
cat ~/.ssh/id_rsa.pub | ssh root@<HOSTNAME_OR_IP> 'cat >> ~/.ssh/authorized_keys'
@rncrtr
rncrtr / pagekite start
Created September 25, 2013 22:23
#pagekite #tunneling
pagekite.py 8080 rncrtr.pagekite.me
@rncrtr
rncrtr / mysql-pdo.php
Created April 30, 2013 18:19
#php #mysql #pdo #connect
<?php
// fill in this info
$dbname = 'dbname';
$server = 'localhost';
$user = 'root';
$pass = 'root';
// db handle
$dbh = new PDO('mysql:host='.$server.'; dbname='.$dbname, $user, $pass, array(PDO::ATTR_PERSISTENT => true));
@rncrtr
rncrtr / connect to mysql database.php
Created April 26, 2013 17:25
#php #mysql #connect #database #oldskool #deprecated
<?php
$dbname = 'database';
$server = 'localhost';
$user = 'root';
$pass = 'root';
$conn = mysql_connect($server, $user, $pass);
mysql_select_db($dbname,$conn);
?>
@rncrtr
rncrtr / image-precache.js
Created April 26, 2013 17:22
#image #precache #js
<script type="text/javascript">
img1 = new Image();
img1.src = 'path/to/image.jpg';
</script>
@rncrtr
rncrtr / error-reporting.php
Last active December 16, 2015 17:10
#php #error #reporting
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
?>