Skip to content

Instantly share code, notes, and snippets.

View jasonmccallister's full-sized avatar

Jason McCallister jasonmccallister

View GitHub Profile
@grenade
grenade / 01-generate-ed25519-ssh-key.sh
Last active June 7, 2024 23:10
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
#!/bin/bash
# generate new personal ed25519 ssh key
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <rthijssen@gmail.com>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs
ssh-keygen -t ed25519 -f manta_host_ca -C manta.network
eval "$(ssh-agent -s)"
@JeffreyWay
JeffreyWay / .vimrc
Last active January 22, 2024 11:42
My .vimrc file
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
@fideloper
fideloper / install.sh
Last active October 30, 2023 20:03
Vagrant Provisioning Script for PHP applications. This installs a LAMP stack.
#!/usr/bin/env bash
echo ">>> Starting Install Script"
# Update
sudo apt-get update
# Install MySQL without prompt
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
@boboldehampsink
boboldehampsink / AssetUploadPlugin.php
Last active December 26, 2015 20:49
Enable this plugin to connect <input type="file" name="fields[yourField]" /> as asset to yourField
<?php
namespace Craft;
class AssetUploadPlugin extends BasePlugin
{
function getName()
{
return Craft::t('Upload assets on the front-end');
}
@brandonkelly
brandonkelly / templating.md
Last active February 7, 2024 15:20
Templating in EE vs. Craft
<?php
/**
* Gets the HTTP status code for the given URL.
*
* @param string $url The URL to check.
* @return int
*/
function url_http_status($url) {
$ch = curl_init($url);
@koomai
koomai / PhpStorm Keyboard Shortcuts.md
Last active May 25, 2024 01:05
Frequently Used PhpStorm Keyboard Shortcuts

Note: Some of these shortcuts have been remapped for my own convenience (Preferences->Keymap). These are Mac shortcuts, just use the Windows/Linux equivalent of the Cmd/Option/Ctrl/Del keys.

####Search, Go to, Navigation ####

Cmd + P - Search file

Cmd + Shift + O - Search everywhere

(I swapped the above two recently because I use Cmd + P to search for files most of the time).

@selvinortiz
selvinortiz / craftplugintesting.md
Last active September 13, 2018 18:23
Unit Testing for Craft Plugins

Unit Testing for Craft Plugins

Writing unit tests for your craft plugin has not been straight forward out of the gate but P&T is taking steps to fully integrate unit testing and have already added the basic necessities to do so.

Assumed Directory Structure


@craft = /path/to/site/craft
@craftTests = @craft/app/tests
@dhrrgn
dhrrgn / install.sh
Last active August 24, 2018 13:06
Setting up Selenium as a Service in OS X
#!/usr/bin/env bash
if [ ! -d /usr/lib/selenium/ ]; then
sudo mkdir /usr/lib/selenium/
fi
if [ ! -f /usr/lib/selenium/selenium-server-standalone-2.41.0.jar ]; then
sudo curl -o /usr/lib/selenium/selenium-server-standalone-2.41.0.jar http://selenium-release.storage.googleapis.com/2.41/selenium-server-standalone-2.41.0.jar
fi
@tmichel
tmichel / email_test.go
Created October 12, 2014 11:58
Sending and testing email in Go -- appendix
package email
import (
"net/smtp"
"testing"
)
type EmailConfig struct {
Username string
Password string