Skip to content

Instantly share code, notes, and snippets.

View JoshuaEstes's full-sized avatar
👨‍💻

Joshua Estes JoshuaEstes

👨‍💻
View GitHub Profile
@JoshuaEstes
JoshuaEstes / 000-Cheat-Sheets.md
Last active February 11, 2024 04:25
Developer Cheat Sheets for bash, git, gpg, irssi, mutt, tmux, and vim. See my dotfiles repository for extra info.
@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 / 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 / heroku_config_set.sh
Last active January 10, 2021 18:04
This is a simple one line command that takes your local .env file and sets all the environmental variables on heroku for you to edit
heroku config:set $(cat .env | tr '\n' ' ' | sed -e 's/export //g')
@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 / 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 / gist:6831131
Created October 4, 2013 19:13
mysql export table into CSV file
mysql -u USERNAME -p DATABASE -e "select * from TABLE;" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g'
@JoshuaEstes
JoshuaEstes / form.html.twig
Last active December 18, 2015 03:18
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 June 3, 2013 16:29
Symfony2 Functional Form Tests
<form id="that-one-form">
{{ form_widget(form) }}
</form>
@JoshuaEstes
JoshuaEstes / database.sql
Last active December 15, 2015 15:17
MySQL Database Size Information
-- 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;