Skip to content

Instantly share code, notes, and snippets.

View crmpicco's full-sized avatar
🏴󠁧󠁢󠁳󠁣󠁴󠁿
Blahem

Craig R Morton crmpicco

🏴󠁧󠁢󠁳󠁣󠁴󠁿
Blahem
View GitHub Profile
@aliang
aliang / Mac SSH Autocomplete
Created June 14, 2011 07:14
Add auto complete to your ssh, put into your .bash_profile
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
grep -v "\[" ;
@loonies
loonies / 1_phpunit-api.md
Last active January 19, 2024 07:34
PHPUnit Cheat Sheet

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this->anything()
@rietta
rietta / random_hash.sh
Created September 5, 2012 17:01
Easy command line random hash generator for Mac OS X, Linux, and FreeBSD.
#!/bin/sh
head -n 4096 /dev/urandom | openssl sha1
@pdewouters
pdewouters / new_gist_file
Created June 21, 2013 15:00
whitelist gitignore
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@alch
alch / .htaccess
Last active July 11, 2024 10:07
Symfony full .htaccess file
# For a symfony application to work properly, you MUST store this .htaccess in
# the same directory as your front controller, index.php, in a standard symfony
# web application is under the "public" project subdirectory.
# Use the front controller as index file.
DirectoryIndex index.php
# Uncomment the following line if you install assets as symlinks or if you
# experience problems related to symlinks when compiling LESS/Sass/CoffeScript.
# Options +FollowSymlinks
@Riveascore
Riveascore / gmail_display_none_workaround.html
Last active April 19, 2017 04:46
Currently trying to use inlined "display: none;" doesn't work for Gmail, so here's the best workaround (of about 3 different approaches I tried).
<!--
You can't do position absolute + visibility/opacity in gmail
display: none; only works if you inline it as !important, but then this destroys the functionality for
all other clients, this workaround has been working wonders for us!!!
-->
<style>
div.gmail {
display: block;
width: 0;
overflow: hidden;
@Lordnibbler
Lordnibbler / pull-request-template.md
Last active October 20, 2022 17:32
Sample Pull Request Template

Status

READY/IN DEVELOPMENT/HOLD

Migrations

YES | NO

Description

A few sentences describing the overall goals of the pull request's commits.

Related PRs

@zuzuleinen
zuzuleinen / csv-symfony-action.php
Last active January 17, 2024 11:04
CSV Response in Symfony controller action
<?php
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class CsvController extends Controller
{
/**
* Get a CSV file from an array
@nepsilon
nepsilon / how-to-git-patch-diff.md
Last active July 22, 2024 07:11
How to generate and apply patches with git? — First published in fullweb.io issue #33

How to generate and apply patches with git?

It sometimes happen you need change code on a machine from which you cannot push to the repo. You’re ready to copy/paste what diff outputs to your local working copy.

You think there must be a better way to proceed and you’re right. It’s a simple 2 steps process:

1. Generate the patch:

git diff &gt; some-changes.patch
@damusix
damusix / aws_iam_secret_to_smtp_password.md
Last active May 12, 2024 03:23
Convert AWS IAM credentials to AWS SMTP credentials

Convert AWS IAM credentials to AWS SMTP credentials

If you do, or want to, use AWS to deploy your apps, you will end up using AWS SES via SMTP when you're launching an app that sends out emails of any kind (user registrations, email notifications, etc). For example, I have used this configuration on various Ruby on Rails apps, however, it is just basic SMTP configurations and crosses over to any framework that supports SMTP sendmail.

There are two ways to go about this:

Luckily, you found this MD file and the NOT SO EASY WAY is suddenly copy-pasta... sudo yum....