Skip to content

Instantly share code, notes, and snippets.

View JoshuaEstes's full-sized avatar
👨‍💻

Joshua Estes JoshuaEstes

👨‍💻
View GitHub Profile
@JoshuaEstes
JoshuaEstes / bitcoin.conf
Created November 13, 2012 14:21
Install bitcoind on linux and setup server
# bitcoin.conf configuration file. Lines beginning with # are comments.
# Network-related settings:
# Run on the test network instead of the real bitcoin network.
#testnet=0
# Connect via a socks4 proxy
#proxy=127.0.0.1:9050
##############################################################
@JoshuaEstes
JoshuaEstes / controller.php
Created October 5, 2012 15:13
Symfony2 Redirect with hashtag
<?php
namespace Acme\BlogBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class AttachmentController extends Controller
{
public function redirectAction()
@JoshuaEstes
JoshuaEstes / DefaultControllerTest.php
Created October 4, 2012 16:38
Create a symfony test client that is authenticated
<?php
namespace Acme\BlogBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class DefaultControllerTest extends WebTestCase
{
public function testIndex()
{
@JoshuaEstes
JoshuaEstes / user.sh
Last active October 10, 2015 07:57
Script to create a deployment user on a linux box
# Remote Server
useradd www-deploy -c "Deployment User" -d /home/www-deploy -G www-data -m -s /bin/bash
sudo su - www-deploy
# Localhost
ssh-keygen -t rsa
# Append your key to the Remote host authorized keys file
cat id_rsa.pub >> ~/.ssh/authorized_keys
@JoshuaEstes
JoshuaEstes / git-remove-untracked.marckdown
Last active October 6, 2015 06:58
Oneline to delete all files that are not tracked in t git repository. Use grep if you only want certain files
Bash oneliner
for file in $(git ls-files --other --exclude-standard); do rm "$file"; done
Git Clean, does the exact same thing
git clean -df
@JoshuaEstes
JoshuaEstes / port-uninstall.sh
Created June 2, 2012 15:47
using mac ports to uninstall something?
port uninstall --follow-dependents ncurses
@JoshuaEstes
JoshuaEstes / mysqldump.sh
Created May 29, 2012 14:43
mysql dump snippet, will output a sql file with the date and time of the dump
mysqldump -u USERNAME -p DATABASE_NAME > $(date +"%m-%d-%y_%H-%M%p").sql
@JoshuaEstes
JoshuaEstes / move-repo.sh
Created May 14, 2012 19:07
Bash script to move git repo from one server to another
#!/usr/bin/env bash
# Repositories
repos=(
CrappyRepo-name-OnE
Crappy--rePO-name-2
)
# Rename repos, if you aren't
# renaming repos, then just
@JoshuaEstes
JoshuaEstes / 000-Cheat-Sheets.md
Last active May 1, 2024 04:03
Developer Cheat Sheets for bash, git, gpg, irssi, mutt, tmux, and vim. See my dotfiles repository for extra info.
@JoshuaEstes
JoshuaEstes / cope.php
Created April 22, 2012 23:18
Break apart an html string, keep the tags and positions
<?php
$text = <<<EOF
<p>there is more to it <i>than</i> this.</p>
<div class="test">more test stuff.</div>
<p>Last bit of text in a paragraph.</p>
<p>Continuing to test this.</p>
EOF;
$plainText = strip_tags($text);