Skip to content

Instantly share code, notes, and snippets.

Joshua Estes JoshuaEstes

Block or report user

Report or block JoshuaEstes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@JoshuaEstes
JoshuaEstes / 000-Cheat-Sheets.md
Last active Jun 4, 2019
Developer Cheat Sheets for bash, git, gpg, irssi, mutt, tmux, and vim. See my dotfiles repository for extra info.
@JoshuaEstes
JoshuaEstes / bitcoin.conf
Created Nov 13, 2012
Install bitcoind on linux and setup server
View bitcoin.conf
# 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 / mysqldump.sh
Created May 29, 2012
mysql dump snippet, will output a sql file with the date and time of the dump
View mysqldump.sh
mysqldump -u USERNAME -p DATABASE_NAME > $(date +"%m-%d-%y_%H-%M%p").sql
@JoshuaEstes
JoshuaEstes / DefaultControllerTest.php
Created Oct 4, 2012
Create a symfony test client that is authenticated
View DefaultControllerTest.php
<?php
namespace Acme\BlogBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class DefaultControllerTest extends WebTestCase
{
public function testIndex()
{
@JoshuaEstes
JoshuaEstes / gist:6831131
Created Oct 4, 2013
mysql export table into CSV file
View gist:6831131
mysql -u USERNAME -p DATABASE -e "select * from TABLE;" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g'
View form.html.twig
{% set email_class = '' %}
{% if form.email.vars.errors %}
{% set email_class = 'error' %}
{% endif %}
{{ form_label(form.email, 'Email', {'label_attr':{'class':email_class}}) }}
{{ form_widget(form.email, {'attr':{'class':email_class}}) }}
{% if form.email.vars.errors %}
{% for error in form.email.vars.errors %}
<small class="error">{{ error.message }}</small>
@JoshuaEstes
JoshuaEstes / form.html.twig
Created Jun 3, 2013
Symfony2 Functional Form Tests
View form.html.twig
<form id="that-one-form">
{{ form_widget(form) }}
</form>
@JoshuaEstes
JoshuaEstes / database.sql
Last active Dec 15, 2015
MySQL Database Size Information
View database.sql
-- Display All Database Sizes in MB
SELECT table_schema AS "Database", ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema;
-- Display All Database Sizes in GB
SELECT table_schema AS "Database", ROUND(SUM(data_length + index_length) / 1024 / 1024 / 1024, 2) AS "Size (GB)" FROM information_schema.TABLES GROUP BY table_schema;
-- Display All Table Sizes for a Database in MB
SELECT table_name AS "Table", ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)" FROM information_schema.TABLES WHERE table_schema = "INSERT DATABASE NAME HERE" ORDER BY (data_length + index_length) DESC;
@JoshuaEstes
JoshuaEstes / Vagrantfile
Last active Dec 15, 2015
Vagrantfile for symfony2
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :forwarded_port, guest: 80, host: 8080
config.vm.network :private_network, ip: "192.168.33.10"
config.vm.synced_folder ".", "/var/www/app.local", :nfs => true
config.vm.provider :virtualbox do |vb|
You can’t perform that action at this time.